Interface SqmPath<T>

All Superinterfaces:
Expression<T>, JpaCriteriaNode, JpaExpression<T>, JpaPath<T>, JpaSelection<T>, JpaTupleElement<T>, Path<T>, Selection<T>, SemanticPathPart, Serializable, SqmExpressibleAccessor<T>, SqmExpression<T>, SqmNode, SqmSelectableNode<T>, SqmTypedNode<T>, SqmVisitableNode, TupleElement<T>
All Known Subinterfaces:
DiscriminatorSqmPath<T>, SqmAttributeJoin<O,T>, SqmCorrelation<O,T>, SqmFrom<O,T>, SqmJoin<O,T>, SqmPathWrapper<W,T>, SqmQualifiedJoin<O,T>, SqmSimplePath<T>, SqmTreatedPath<T,S>
All Known Implementing Classes:
AbstractSqmAttributeJoin, AbstractSqmFrom, AbstractSqmJoin, AbstractSqmPath, AbstractSqmPluralJoin, AbstractSqmQualifiedJoin, AbstractSqmSimplePath, AbstractSqmSpecificPluralPartPath, AnyDiscriminatorSqmPath, EmbeddedDiscriminatorSqmPath, EntityDiscriminatorSqmPath, NonAggregatedCompositeSimplePath, SqmAnyValuedSimplePath, SqmBagJoin, SqmBasicValuedSimplePath, SqmCorrelatedBagJoin, SqmCorrelatedCrossJoin, SqmCorrelatedEntityJoin, SqmCorrelatedListJoin, SqmCorrelatedMapJoin, SqmCorrelatedPluralPartJoin, SqmCorrelatedRoot, SqmCorrelatedRootJoin, SqmCorrelatedSetJoin, SqmCorrelatedSingularJoin, SqmCrossJoin, SqmCteJoin, SqmCteRoot, SqmDerivedJoin, SqmDerivedRoot, SqmElementAggregateFunction, SqmEmbeddedValuedSimplePath, SqmEntityJoin, SqmEntityValuedSimplePath, SqmFkExpression, SqmFunctionPath, SqmIndexAggregateFunction, SqmIndexedCollectionAccessPath, SqmListJoin, SqmMapJoin, SqmPluralPartJoin, SqmPluralValuedSimplePath, SqmRoot, SqmSetJoin, SqmSingularJoin, SqmTreatedBagJoin, SqmTreatedCrossJoin, SqmTreatedEmbeddedValuedSimplePath, SqmTreatedEntityJoin, SqmTreatedEntityValuedSimplePath, SqmTreatedListJoin, SqmTreatedMapJoin, SqmTreatedPluralPartJoin, SqmTreatedRoot, SqmTreatedSetJoin, SqmTreatedSingularJoin

public interface SqmPath<T> extends SqmExpression<T>, SemanticPathPart, JpaPath<T>
Models a reference to a part of the application's domain model as part of an SQM tree. This correlates roughly to the JPA Criteria notion of Path, hence the name.
Author:
Steve Ebersole
  • Method Details

    • getNavigablePath

      NavigablePath getNavigablePath()
      Returns the NavigablePath.
      Specified by:
      getNavigablePath in interface JpaPath<T>
    • getReferencedPathSource

      SqmPathSource<?> getReferencedPathSource()
      The path source that this path refers to (and that most likely created it).
      See Also:
    • getExplicitAlias

      String getExplicitAlias()
      Retrieve the explicit alias, if one. May return null
    • setExplicitAlias

      void setExplicitAlias(String explicitAlias)
      Set the explicit alias for this path
    • resolveAlias

      default String resolveAlias()
      Retrieve the explicit alias, if one, otherwise return a generated one and set that as explicit alias.
    • getLhs

      SqmPath<?> getLhs()
      Get the left-hand side of this path - may be null, indicating a root, cross-join or entity-join
      Specified by:
      getLhs in interface JpaPath<T>
    • getReusablePaths

      List<SqmPath<?>> getReusablePaths()
      Returns an immutable List of reusable paths
    • visitReusablePaths

      void visitReusablePaths(Consumer<SqmPath<?>> consumer)
      Visit each reusable path relative to this path
    • registerReusablePath

      void registerReusablePath(SqmPath<?> path)
      Register a reusable path relative to this path
    • getReusablePath

      SqmPath<?> getReusablePath(String name)
    • getNodeType

      SqmPathSource<T> getNodeType()
      This node's type is its "referenced path source"
      Specified by:
      getNodeType in interface SqmExpression<T>
      Specified by:
      getNodeType in interface SqmTypedNode<T>
    • applyInferableType

      default void applyInferableType(@Nullable SqmExpressible<?> type)
      Description copied from interface: SqmExpression
      Used to apply type information based on the expression's usage within the query.
      Specified by:
      applyInferableType in interface SqmExpression<T>
    • getJavaTypeDescriptor

      default JavaType<T> getJavaTypeDescriptor()
      Specified by:
      getJavaTypeDescriptor in interface JpaTupleElement<T>
    • treatAs

      <S extends T> SqmPath<S> treatAs(Class<S> treatJavaType)
      Description copied from interface: JpaPath
      Support for JPA's explicit (TREAT) down-casting.
      Specified by:
      treatAs in interface JpaPath<T>
    • treatAs

      <S extends T> SqmPath<S> treatAs(EntityDomainType<S> treatTarget)
      Description copied from interface: JpaPath
      Support for JPA's explicit (TREAT) down-casting.
      Specified by:
      treatAs in interface JpaPath<T>
    • findRoot

      default SqmRoot<?> findRoot()
    • resolvePathPart

      SqmPath<?> resolvePathPart(String name, boolean isTerminal, SqmCreationState creationState)
      Specified by:
      resolvePathPart in interface SemanticPathPart
    • resolveIndexedAccess

      default SqmPath<?> resolveIndexedAccess(SqmExpression<?> selector, boolean isTerminal, SqmCreationState creationState)
      Specified by:
      resolveIndexedAccess in interface SemanticPathPart
    • getResolvedModel

      SqmPathSource<?> getResolvedModel()
      Get this path's actual resolved model, i.e. the concrete type for generic attributes.
    • get

      <Y> SqmPath<Y> get(SingularAttribute<? super T,Y> attribute)
      Description copied from interface: Path
      Create a path corresponding to the referenced single-valued attribute.
      Specified by:
      get in interface JpaPath<T>
      Specified by:
      get in interface Path<T>
      Parameters:
      attribute - single-valued attribute
      Returns:
      path corresponding to the referenced attribute
    • get

      <E, C extends Collection<E>> SqmExpression<C> get(PluralAttribute<T,C,E> collection)
      Description copied from interface: Path
      Create a path corresponding to the referenced collection-valued attribute.
      Specified by:
      get in interface JpaPath<T>
      Specified by:
      get in interface Path<T>
      Parameters:
      collection - collection-valued attribute
      Returns:
      expression corresponding to the referenced attribute
    • get

      <K, V, M extends Map<K, V>> SqmExpression<M> get(MapAttribute<T,K,V> map)
      Description copied from interface: Path
      Create a path corresponding to the referenced map-valued attribute.
      Specified by:
      get in interface JpaPath<T>
      Specified by:
      get in interface Path<T>
      Parameters:
      map - map-valued attribute
      Returns:
      expression corresponding to the referenced attribute
    • type

      SqmExpression<Class<? extends T>> type()
      Description copied from interface: Path
      Create an expression corresponding to the type of the path.
      Specified by:
      type in interface JpaPath<T>
      Specified by:
      type in interface Path<T>
      Returns:
      expression corresponding to the type of the path
    • get

      <Y> SqmPath<Y> get(String attributeName)
      Description copied from interface: Path
      Create a path corresponding to the referenced attribute.

      Note: Applications using the string-based API may need to specify the type resulting from the get operation in order to avoid the use of Path variables.

           For example:
      
           CriteriaQuery<Person> q = cb.createQuery(Person.class);
           Root<Person> p = q.from(Person.class);
           q.select(p)
            .where(cb.isMember("joe",
                               p.<Set<String>>get("nicknames")));
      
           rather than:
       
           CriteriaQuery<Person> q = cb.createQuery(Person.class);
           Root<Person> p = q.from(Person.class);
           Path<Set<String>> nicknames = p.get("nicknames");
           q.select(p)
            .where(cb.isMember("joe", nicknames));
        
      Specified by:
      get in interface JpaPath<T>
      Specified by:
      get in interface Path<T>
      Parameters:
      attributeName - name of the attribute
      Returns:
      path corresponding to the referenced attribute
    • copy

      SqmPath<T> copy(SqmCopyContext context)
      Specified by:
      copy in interface SqmExpression<T>
      Specified by:
      copy in interface SqmNode
      Specified by:
      copy in interface SqmSelectableNode<T>
      Specified by:
      copy in interface SqmTypedNode<T>