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
Modifier and TypeFieldDescriptionprotected final jakarta.persistence.criteria.CriteriaBuilder
protected boolean
protected PersistentEntityRoot<?>
protected boolean
protected int
protected int
protected List<jakarta.persistence.criteria.Order>
protected jakarta.persistence.criteria.Predicate
protected final ExpressionType<T>
protected jakarta.persistence.criteria.Selection<?>
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractPersistentEntityQuery
(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.Predicate
jakarta.persistence.criteria.Predicate
Set<jakarta.persistence.criteria.Root<?>>
getRoots()
jakarta.persistence.criteria.Selection<T>
groupBy
(jakarta.persistence.criteria.Expression<?>... grouping) final boolean
final boolean
having
(jakarta.persistence.criteria.Predicate... restrictions) boolean
limit
(int limit) Sets the max rows.offset
(int offset) Sets the offset.protected abstract Self
self()
where
(jakarta.persistence.criteria.Predicate... restrictions) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.data.model.jpa.criteria.PersistentEntityCommonAbstractCriteria
subquery, subquery
Methods inherited from interface io.micronaut.data.model.jpa.criteria.PersistentEntityQuery
orderBy, orderBy
Methods 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
-
getParametersInRole
-
self
- Returns:
- The self instance
-
buildQuery
public QueryResult buildQuery(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder2 queryBuilder) - Specified by:
buildQuery
in interfaceQueryResultPersistentEntityCriteriaQuery
-
toSelectQueryDefinition
- Returns:
- Build
QueryBuilder2.SelectQueryDefinition
.
-
from
- Specified by:
from
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
from
- Specified by:
from
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
from
Description copied from interface:PersistentEntityQuery
Create a root usingPersistentEntity
.- Specified by:
from
in interfacePersistentEntityQuery<T>
- Type Parameters:
X
- The root type- Parameters:
persistentEntity
- The persistent entity- Returns:
- The root
-
limit
Sets the max rows.- Specified by:
limit
in interfacePersistentEntityQuery<T>
- Parameters:
limit
- The max ros- Returns:
- self
-
offset
Sets the offset.- Specified by:
offset
in interfacePersistentEntityQuery<T>
- Parameters:
offset
- The offset- Returns:
- self
-
forUpdate
Enables the query for update.- Parameters:
forUpdate
- The for update- Returns:
- self
-
where
- Specified by:
where
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
where
- Specified by:
where
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
groupBy
- Specified by:
groupBy
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
groupBy
- Specified by:
groupBy
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
having
- Specified by:
having
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
having
- Specified by:
having
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
distinct
- Specified by:
distinct
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getRoots
- Specified by:
getRoots
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getGroupList
- Specified by:
getGroupList
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getGroupRestriction
public jakarta.persistence.criteria.Predicate getGroupRestriction()- Specified by:
getGroupRestriction
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
isDistinct
public boolean isDistinct()- Specified by:
isDistinct
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getResultType
- Specified by:
getResultType
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getSelection
- Specified by:
getSelection
in interfacejakarta.persistence.criteria.AbstractQuery<T>
-
getRestriction
public jakarta.persistence.criteria.Predicate getRestriction()- Specified by:
getRestriction
in interfacejakarta.persistence.criteria.CommonAbstractCriteria
-
hasOnlyIdRestriction
public final boolean hasOnlyIdRestriction() -
hasVersionRestriction
public final boolean hasVersionRestriction()
-