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:
PersistentEntityCommonAbstractCriteria,PersistentEntityCriteriaQueryBuilder,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>, 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 TypeMethodDescriptionbuild(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder queryBuilder) Build the query.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.PredicateThe persistent entity.jakarta.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 jakarta.persistence.criteria.AbstractQuery
having, whereMethods inherited from interface jakarta.persistence.criteria.CommonAbstractCriteria
getParameters, subqueryMethods inherited from interface io.micronaut.data.model.jpa.criteria.PersistentEntityCommonAbstractCriteria
subquery, subqueryMethods inherited from interface io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaQueryBuilder
buildMethods inherited from interface io.micronaut.data.model.jpa.criteria.PersistentEntityQuery
orderBy, orderBy
-
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
Description copied from interface:PersistentEntityCommonAbstractCriteriaThe persistent entity.- Specified by:
getPersistentEntityin interfacePersistentEntityCommonAbstractCriteria- Returns:
- The persistent entity
-
getParametersInRole
-
self
- Returns:
- The self instance
-
build
public QueryResult build(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder queryBuilder) Description copied from interface:PersistentEntityCriteriaQueryBuilderBuild the query.- Specified by:
buildin interfacePersistentEntityCriteriaQueryBuilder- Parameters:
annotationMetadata- The annotation metadata.queryBuilder- The query builder- Returns:
- The query result
-
toSelectQueryDefinition
- Returns:
- Build
QueryBuilder.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()
-