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 result
Self - 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 Details

    • parametersInRole

      protected Map<String,Integer> parametersInRole
    • criteriaBuilder

      protected final jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder
    • resultType

      protected final ExpressionType<T> resultType
    • predicate

      protected jakarta.persistence.criteria.Predicate predicate
    • selection

      protected jakarta.persistence.criteria.Selection<?> selection
    • entityRoot

      protected PersistentEntityRoot<?> entityRoot
    • orders

      protected List<jakarta.persistence.criteria.Order> 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

      public final Map<String,Integer> getParametersInRole()
    • self

      protected abstract Self self()
      Returns:
      The self instance
    • buildQuery

      public QueryResult buildQuery(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder2 queryBuilder)
      Specified by:
      buildQuery in interface QueryResultPersistentEntityCriteriaQuery
    • toSelectQueryDefinition

      public QueryBuilder2.SelectQueryDefinition toSelectQueryDefinition()
      Returns:
      Build QueryBuilder2.SelectQueryDefinition.
    • from

      public abstract <X> PersistentEntityRoot<X> from(Class<X> entityClass)
      Specified by:
      from in interface jakarta.persistence.criteria.AbstractQuery<T>
    • from

      public <X> PersistentEntityRoot<X> from(jakarta.persistence.metamodel.EntityType<X> entity)
      Specified by:
      from in interface jakarta.persistence.criteria.AbstractQuery<T>
    • from

      public abstract <X> PersistentEntityRoot<X> from(PersistentEntity persistentEntity)
      Description copied from interface: PersistentEntityQuery
      Create a root using PersistentEntity.
      Specified by:
      from in interface PersistentEntityQuery<T>
      Type Parameters:
      X - The root type
      Parameters:
      persistentEntity - The persistent entity
      Returns:
      The root
    • limit

      public Self limit(int limit)
      Sets the max rows.
      Specified by:
      limit in interface PersistentEntityQuery<T>
      Parameters:
      limit - The max ros
      Returns:
      self
    • offset

      public Self offset(int offset)
      Sets the offset.
      Specified by:
      offset in interface PersistentEntityQuery<T>
      Parameters:
      offset - The offset
      Returns:
      self
    • forUpdate

      public Self forUpdate(boolean forUpdate)
      Enables the query for update.
      Parameters:
      forUpdate - The for update
      Returns:
      self
    • where

      public Self where(jakarta.persistence.criteria.Expression<Boolean> restriction)
      Specified by:
      where in interface jakarta.persistence.criteria.AbstractQuery<T>
    • where

      public Self where(jakarta.persistence.criteria.Predicate... restrictions)
      Specified by:
      where in interface jakarta.persistence.criteria.AbstractQuery<T>
    • groupBy

      public Self groupBy(jakarta.persistence.criteria.Expression<?>... grouping)
      Specified by:
      groupBy in interface jakarta.persistence.criteria.AbstractQuery<T>
    • groupBy

      public Self groupBy(List<jakarta.persistence.criteria.Expression<?>> grouping)
      Specified by:
      groupBy in interface jakarta.persistence.criteria.AbstractQuery<T>
    • having

      public Self having(jakarta.persistence.criteria.Expression<Boolean> restriction)
      Specified by:
      having in interface jakarta.persistence.criteria.AbstractQuery<T>
    • having

      public Self having(jakarta.persistence.criteria.Predicate... restrictions)
      Specified by:
      having in interface jakarta.persistence.criteria.AbstractQuery<T>
    • distinct

      public Self distinct(boolean distinct)
      Specified by:
      distinct in interface jakarta.persistence.criteria.AbstractQuery<T>
    • getRoots

      public Set<jakarta.persistence.criteria.Root<?>> getRoots()
      Specified by:
      getRoots in interface jakarta.persistence.criteria.AbstractQuery<T>
    • getGroupList

      public List<jakarta.persistence.criteria.Expression<?>> getGroupList()
      Specified by:
      getGroupList in interface jakarta.persistence.criteria.AbstractQuery<T>
    • getGroupRestriction

      public jakarta.persistence.criteria.Predicate getGroupRestriction()
      Specified by:
      getGroupRestriction in interface jakarta.persistence.criteria.AbstractQuery<T>
    • isDistinct

      public boolean isDistinct()
      Specified by:
      isDistinct in interface jakarta.persistence.criteria.AbstractQuery<T>
    • getResultType

      public Class<T> getResultType()
      Specified by:
      getResultType in interface jakarta.persistence.criteria.AbstractQuery<T>
    • getSelection

      public jakarta.persistence.criteria.Selection<T> getSelection()
      Specified by:
      getSelection in interface jakarta.persistence.criteria.AbstractQuery<T>
    • getRestriction

      public jakarta.persistence.criteria.Predicate getRestriction()
      Specified by:
      getRestriction in interface jakarta.persistence.criteria.CommonAbstractCriteria
    • hasOnlyIdRestriction

      public final boolean hasOnlyIdRestriction()
    • hasVersionRestriction

      public final boolean hasVersionRestriction()