org.azzyzt.jee.runtime.util
Class QueryBuilder<ID,T extends EntityBase<ID>>
java.lang.Object
org.azzyzt.jee.runtime.util.QueryBuilder<ID,T>
- Type Parameters:
ID
- Type of the ID of the entity class of the query resultT
- Type of the entity class or the query result
public class QueryBuilder<ID,T extends EntityBase<ID>>
- extends java.lang.Object
Uses a JPA criteria builder to create a typed query equivalent to a QuerySpec
.
While building, the query is validated against type meta information generated by
Azzyzt JEE Tools, in order to make sure that only existing and mapped associations
can be followed.
- See Also:
QuerySpec
,
EntityBase
Method Summary |
javax.persistence.TypedQuery<T> |
build()
builds the typed query |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QueryBuilder
public QueryBuilder(javax.persistence.EntityManager em,
QuerySpec qs,
java.lang.Class<T> clazz,
TypeMetaInfoInterface tmi)
- Parameters:
em
- a JPA EntityManager
qs
- a query specificationclazz
- the class of the resulting entitiestmi
- type meta information generated by Azzyzt JEE Tools
build
public javax.persistence.TypedQuery<T> build()
throws InvalidFieldException,
AccessDeniedException,
QuerySyntaxException,
NotYetImplementedException
- builds the typed query
- Returns:
- A JPA typed query
- Throws:
InvalidFieldException
AccessDeniedException
QuerySyntaxException
NotYetImplementedException