Class JPAQueryBuilder<T,ID>
java.lang.Object
com.peterphi.std.guice.hibernate.webquery.impl.jpa.JPAQueryBuilder<T,ID>
- All Implemented Interfaces:
JPAQueryBuilderInternal
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addConstraints
(List<WQConstraintLine> constraints) Add new constraints as if they'd been defined at the top level of the WebQuery (N.B.void
addConstraints
(javax.persistence.criteria.Predicate... predicates) Add new Predicates which will be ANDed together with the top-level constraints specified in the WebQueryvoid
Set 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.Query
createSelectCustomProjection
(String... fields) org.hibernate.query.Query<T>
org.hibernate.query.Query
void
void
forWebQuery
(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) boolean
Returns true if one of the fetches specified will result in a collection being pulled backboolean
Returns true if one of the non-fetch joins specified will result in a collection being pulled backvoid
limit
(int limit) void
offset
(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:JPAQueryBuilderInternal
Add new Predicates which will be ANDed together with the top-level constraints specified in the WebQuery- Specified by:
addConstraints
in interfaceJPAQueryBuilderInternal
- Parameters:
predicates
- the predicate(s) to add
-
addConstraints
Description copied from interface:JPAQueryBuilderInternal
Add 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:
addConstraints
in interfaceJPAQueryBuilderInternal
-
getProperty
-
getProperty
Get a property, automatically creating any joins along the way as needed- Specified by:
getProperty
in interfaceJPAQueryBuilderInternal
- Parameters:
path
-- Returns:
-
getOrCreateJoin
Ensure a join has been set up for a path- Specified by:
getOrCreateJoin
in 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:JPAQueryBuilderInternal
Set up fetch joins as specified by the dbfetch/expand/default EAGER fetch annotations- Specified by:
applyFetches
in 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)
-