Class AbstractPersistentEntityQuery<T,Self extends PersistentEntityQuery<T>>
java.lang.Object
io.micronaut.data.model.jpa.criteria.impl.AbstractPersistentEntityQuery<T,Self>
- Type Parameters:
T- The type of the resultSelf- The self type
- All Implemented Interfaces:
QueryResultPersistentEntityCriteriaQuery,PersistentEntityCommonAbstractCriteria,PersistentEntityQuery<T>,jakarta.persistence.criteria.AbstractQuery<T>,jakarta.persistence.criteria.CommonAbstractCriteria
- Direct Known Subclasses:
AbstractPersistentEntityCriteriaQuery,AbstractPersistentEntitySubquery
@Internal
public abstract class AbstractPersistentEntityQuery<T,Self extends PersistentEntityQuery<T>>
extends Object
implements jakarta.persistence.criteria.AbstractQuery<T>, QueryResultPersistentEntityCriteriaQuery, PersistentEntityQuery<T>
The abstract implementation of
PersistentEntityCriteriaQuery.- Since:
- 3.2
- Author:
- Denis Stepanov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final jakarta.persistence.criteria.CriteriaBuilderprotected booleanprotected PersistentEntityRoot<?>protected booleanprotected intprotected intprotected List<jakarta.persistence.criteria.Order>protected jakarta.persistence.criteria.Predicateprotected final ExpressionType<T>protected jakarta.persistence.criteria.Selection<?> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPersistentEntityQuery(ExpressionType<T> resultType, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) -
Method Summary
Modifier and TypeMethodDescriptionbuildQuery(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder2 queryBuilder) distinct(boolean distinct) forUpdate(boolean forUpdate) Enables the query for update.abstract <X> PersistentEntityRoot<X>from(PersistentEntity persistentEntity) Create a root usingPersistentEntity.<X> PersistentEntityRoot<X>from(jakarta.persistence.metamodel.EntityType<X> entity) abstract <X> PersistentEntityRoot<X>List<jakarta.persistence.criteria.Expression<?>>jakarta.persistence.criteria.Predicatejakarta.persistence.criteria.PredicateSet<jakarta.persistence.criteria.Root<?>>getRoots()jakarta.persistence.criteria.Selection<T>groupBy(jakarta.persistence.criteria.Expression<?>... grouping) final booleanfinal booleanhaving(jakarta.persistence.criteria.Predicate... restrictions) booleanlimit(int limit) Sets the max rows.offset(int offset) Sets the offset.protected abstract Selfself()where(jakarta.persistence.criteria.Predicate... restrictions) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.data.model.jpa.criteria.PersistentEntityCommonAbstractCriteria
subquery, subqueryMethods inherited from interface io.micronaut.data.model.jpa.criteria.PersistentEntityQuery
orderBy, orderByMethods inherited from interface io.micronaut.data.model.jpa.criteria.impl.QueryResultPersistentEntityCriteriaQuery
buildQuery
-
Field Details
-
parametersInRole
-
criteriaBuilder
protected final jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder -
resultType
-
predicate
protected jakarta.persistence.criteria.Predicate predicate -
selection
protected jakarta.persistence.criteria.Selection<?> selection -
entityRoot
-
orders
-
max
protected int max -
offset
protected int offset -
forUpdate
protected boolean forUpdate -
distinct
protected boolean distinct
-
-
Constructor Details
-
AbstractPersistentEntityQuery
protected AbstractPersistentEntityQuery(ExpressionType<T> resultType, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder)
-
-
Method Details
-
getPersistentEntity
- Specified by:
getPersistentEntityin interfacePersistentEntityCommonAbstractCriteria
-
getParametersInRole
-
self
- Returns:
- The self instance
-
buildQuery
public QueryResult buildQuery(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder2 queryBuilder) - Specified by:
buildQueryin interfaceQueryResultPersistentEntityCriteriaQuery
-
toSelectQueryDefinition
- Returns:
- Build
QueryBuilder2.SelectQueryDefinition.
-
from
- Specified by:
fromin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
from
- Specified by:
fromin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
from
Description copied from interface:PersistentEntityQueryCreate a root usingPersistentEntity.- Specified by:
fromin interfacePersistentEntityQuery<T>- Type Parameters:
X- The root type- Parameters:
persistentEntity- The persistent entity- Returns:
- The root
-
limit
Sets the max rows.- Specified by:
limitin interfacePersistentEntityQuery<T>- Parameters:
limit- The max ros- Returns:
- self
-
offset
Sets the offset.- Specified by:
offsetin interfacePersistentEntityQuery<T>- Parameters:
offset- The offset- Returns:
- self
-
forUpdate
Enables the query for update.- Parameters:
forUpdate- The for update- Returns:
- self
-
where
- Specified by:
wherein interfacejakarta.persistence.criteria.AbstractQuery<T>
-
where
- Specified by:
wherein interfacejakarta.persistence.criteria.AbstractQuery<T>
-
groupBy
- Specified by:
groupByin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
groupBy
- Specified by:
groupByin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
having
- Specified by:
havingin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
having
- Specified by:
havingin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
distinct
- Specified by:
distinctin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getRoots
- Specified by:
getRootsin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getGroupList
- Specified by:
getGroupListin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getGroupRestriction
public jakarta.persistence.criteria.Predicate getGroupRestriction()- Specified by:
getGroupRestrictionin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
isDistinct
public boolean isDistinct()- Specified by:
isDistinctin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getResultType
- Specified by:
getResultTypein interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getSelection
- Specified by:
getSelectionin interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getRestriction
public jakarta.persistence.criteria.Predicate getRestriction()- Specified by:
getRestrictionin interfacejakarta.persistence.criteria.CommonAbstractCriteria
-
hasOnlyIdRestriction
public final boolean hasOnlyIdRestriction() -
hasVersionRestriction
public final boolean hasVersionRestriction()
-