Class AbstractSqmPath<T>

All Implemented Interfaces:
Expression<T>, Path<T>, Selection<T>, TupleElement<T>, Serializable, JpaCriteriaNode, JpaExpression<T>, JpaPath<T>, JpaSelection<T>, JpaTupleElement<T>, SemanticPathPart, SqmPath<T>, SqmExpression<T>, SqmSelectableNode<T>, SqmExpressibleAccessor<T>, SqmNode, SqmTypedNode<T>, SqmVisitableNode
Direct Known Subclasses:
AbstractSqmFrom, AbstractSqmSimplePath, AbstractSqmSpecificPluralPartPath, AnyDiscriminatorSqmPath, EmbeddedDiscriminatorSqmPath, EntityDiscriminatorSqmPath, SqmFkExpression, SqmFunctionPath, SqmIndexedCollectionAccessPath

public abstract class AbstractSqmPath<T> extends AbstractSqmExpression<T> implements SqmPath<T>
Author:
Steve Ebersole
See Also:
  • Constructor Details

  • Method Details

    • copyTo

      protected void copyTo(AbstractSqmPath<T> target, SqmCopyContext context)
    • getNodeType

      public SqmPathSource<T> getNodeType()
      Description copied from interface: SqmPath
      This node's type is its "referenced path source"
      Specified by:
      getNodeType in interface SqmExpression<T>
      Specified by:
      getNodeType in interface SqmPath<T>
      Specified by:
      getNodeType in interface SqmTypedNode<T>
      Overrides:
      getNodeType in class AbstractJpaTupleElement<T>
    • getReferencedPathSource

      public SqmPathSource<T> getReferencedPathSource()
      Description copied from interface: SqmPath
      The path source that this path refers to (and that most likely created it).
      Specified by:
      getReferencedPathSource in interface SqmPath<T>
      See Also:
    • getNavigablePath

      public NavigablePath getNavigablePath()
      Description copied from interface: SqmPath
      Returns the NavigablePath.
      Specified by:
      getNavigablePath in interface JpaPath<T>
      Specified by:
      getNavigablePath in interface SqmPath<T>
    • getLhs

      public SqmPath<?> getLhs()
      Description copied from interface: SqmPath
      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>
      Specified by:
      getLhs in interface SqmPath<T>
    • getReusablePaths

      public List<SqmPath<?>> getReusablePaths()
      Description copied from interface: SqmPath
      Returns an immutable List of reusable paths
      Specified by:
      getReusablePaths in interface SqmPath<T>
    • visitReusablePaths

      public void visitReusablePaths(Consumer<SqmPath<?>> consumer)
      Description copied from interface: SqmPath
      Visit each reusable path relative to this path
      Specified by:
      visitReusablePaths in interface SqmPath<T>
    • registerReusablePath

      public void registerReusablePath(SqmPath<?> path)
      Description copied from interface: SqmPath
      Register a reusable path relative to this path
      Specified by:
      registerReusablePath in interface SqmPath<T>
    • getReusablePath

      public SqmPath<?> getReusablePath(String name)
      Specified by:
      getReusablePath in interface SqmPath<T>
    • getExplicitAlias

      public String getExplicitAlias()
      Description copied from interface: SqmPath
      Retrieve the explicit alias, if one. May return null
      Specified by:
      getExplicitAlias in interface SqmPath<T>
    • setExplicitAlias

      public void setExplicitAlias(String explicitAlias)
      Description copied from interface: SqmPath
      Set the explicit alias for this path
      Specified by:
      setExplicitAlias in interface SqmPath<T>
    • getModel

      public SqmPathSource<T> getModel()
      Description copied from interface: Path
      Return the bindable object that corresponds to the path expression.
      Specified by:
      getModel in interface Path<T>
      Returns:
      bindable object corresponding to the path
    • getResolvedModel

      public SqmPathSource<?> getResolvedModel()
      Description copied from interface: SqmPath
      Get this path's actual resolved model, i.e. the concrete type for generic attributes.
      Specified by:
      getResolvedModel in interface SqmPath<T>
    • getExpressible

      public SqmExpressible<T> getExpressible()
      Specified by:
      getExpressible in interface SqmExpressibleAccessor<T>
      Specified by:
      getExpressible in interface SqmTypedNode<T>
    • type

      public 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>
      Specified by:
      type in interface SqmPath<T>
      Returns:
      expression corresponding to the type of the path
    • get

      public SqmPath<?> 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>
      Specified by:
      get in interface SqmPath<T>
      Parameters:
      attributeName - name of the attribute
      Returns:
      path corresponding to the referenced attribute
    • resolvePath

      protected <X> SqmPath<X> resolvePath(PersistentAttribute<?,X> attribute)
    • resolvePath

      protected <X> SqmPath<X> resolvePath(String attributeName, SqmPathSource<X> pathSource)
    • getTreatedPath

      protected <S extends T> SqmTreatedPath<T,S> getTreatedPath(ManagedDomainType<S> treatTarget)
    • getNavigablePathCopy

      protected NavigablePath getNavigablePathCopy(SqmPath<?> parent)
      Utility that checks if this path's parent navigable path is compatible with the specified SQM parent, and if not creates a copy of the navigable path with the correct parent.
    • get

      public <Y> SqmPath<Y> get(SingularAttribute<? super T,Y> jpaAttribute)
      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>
      Specified by:
      get in interface SqmPath<T>
      Parameters:
      jpaAttribute - single-valued attribute
      Returns:
      path corresponding to the referenced attribute
    • get

      public <E, C extends Collection<E>> SqmPath<C> get(PluralAttribute<T,C,E> attribute)
      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>
      Specified by:
      get in interface SqmPath<T>
      Parameters:
      attribute - collection-valued attribute
      Returns:
      expression corresponding to the referenced attribute
    • get

      public <K, V, M extends Map<K, V>> SqmPath<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>
      Specified by:
      get in interface SqmPath<T>
      Parameters:
      map - map-valued attribute
      Returns:
      expression corresponding to the referenced attribute
    • toString

      public String toString()
      Overrides:
      toString in class Object