Annotation Interface CheckHQL
The Metamodel Generator or Query Validator must be enabled as an annotation processor in the project build. Otherwise, if neither is enabled, this annotation has no effect.
If only the Metamodel Generator is enabled, only arguments to the following annotations are validated:
Otherwise, if the Query validator is enabled, then, within the
scope annotated @CheckHQL, any static string argument to
any one of the following methods is interpreted as HQL/JPQL and
validated:
EntityManager.createQuery(String,Class),EntityManager.createQuery(String),QueryProducer.createSelectionQuery(String,Class), orQueryProducer.createMutationQuery(String)
The entity classes referred to by the queries must be annotated
with basic JPA metadata annotations like @Entity,
@ManyToOne, @Embeddable, @MappedSuperclass,
@ElementCollection, and @Access. Metadata specified
in XML mapping documents is ignored by the query validator.
Syntax errors, unknown entity names and unknown entity member names, and typing errors all result in compile-time errors.
- Since:
- 6.3
- Author:
- Gavin King
- See Also:
-
Optional Element Summary
Optional Elements