Class JPAQueryBuilder<T,ID>
java.lang.Object
com.peterphi.std.guice.hibernate.webquery.impl.jpa.JPAQueryBuilder<T,ID>
- All Implemented Interfaces:
JPAQueryBuilderInternal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstraints(List<WQConstraintLine> constraints) Add new constraints as if they'd been defined at the top level of the WebQuery (N.B.voidaddConstraints(javax.persistence.criteria.Predicate... predicates) Add new Predicates which will be ANDed together with the top-level constraints specified in the WebQueryvoidSet up fetch joins as specified by the dbfetch/expand/default EAGER fetch annotationsorg.hibernate.query.Query<Long><C> org.hibernate.query.Query<C>createSelectCustom(JPAQueryCustomiser customiser) org.hibernate.query.QuerycreateSelectCustomProjection(String... fields) org.hibernate.query.Query<T>org.hibernate.query.QueryvoidvoidforWebQuery(WebQuery query) getOrCreateJoin(WQPath path) Ensure a join has been set up for a pathjavax.persistence.criteria.Expression<?>getProperty(WQPath path) Get a property, automatically creating any joins along the way as neededjavax.persistence.criteria.Expression<?>getProperty(String path) booleanReturns true if one of the fetches specified will result in a collection being pulled backbooleanReturns true if one of the non-fetch joins specified will result in a collection being pulled backvoidlimit(int limit) voidoffset(int offset) <C> List<C>selectCustom(JPAQueryCustomiser customiser) selectCustomProjection(String... fields) <ID> List<ID>
-
Constructor Details
-
JPAQueryBuilder
-
-
Method Details
-
addConstraints
public void addConstraints(javax.persistence.criteria.Predicate... predicates) Description copied from interface:JPAQueryBuilderInternalAdd new Predicates which will be ANDed together with the top-level constraints specified in the WebQuery- Specified by:
addConstraintsin interfaceJPAQueryBuilderInternal- Parameters:
predicates- the predicate(s) to add
-
addConstraints
Description copied from interface:JPAQueryBuilderInternalAdd new constraints as if they'd been defined at the top level of the WebQuery (N.B. will be ANDed together with all other constraints- Specified by:
addConstraintsin interfaceJPAQueryBuilderInternal
-
getProperty
-
getProperty
Get a property, automatically creating any joins along the way as needed- Specified by:
getPropertyin interfaceJPAQueryBuilderInternal- Parameters:
path-- Returns:
-
getOrCreateJoin
Ensure a join has been set up for a path- Specified by:
getOrCreateJoinin interfaceJPAQueryBuilderInternal- Parameters:
path-- Returns:
-
forWebQuery
-
forIDs
-
selectCount
-
selectIDs
-
selectCustomProjection
-
selectEntity
-
createSelectCount
-
selectCustom
-
createSelectCustom
-
createSelectCustomProjection
-
createSelectIDs
public org.hibernate.query.Query createSelectIDs() -
createSelectEntity
-
applyFetches
public void applyFetches()Description copied from interface:JPAQueryBuilderInternalSet up fetch joins as specified by the dbfetch/expand/default EAGER fetch annotations- Specified by:
applyFetchesin interfaceJPAQueryBuilderInternal
-
hasCollectionJoin
public boolean hasCollectionJoin()Returns true if one of the non-fetch joins specified will result in a collection being pulled back- Returns:
-
hasCollectionFetch
public boolean hasCollectionFetch()Returns true if one of the fetches specified will result in a collection being pulled back -
offset
public void offset(int offset) -
limit
public void limit(int limit)
-