Interface JpaPath<T>

All Superinterfaces:
Expression<T>, JpaCriteriaNode, JpaExpression<T>, JpaSelection<T>, JpaTupleElement<T>, Path<T>, Selection<T>, Serializable, TupleElement<T>
All Known Subinterfaces:
DiscriminatorSqmPath<T>, JpaCollectionJoin<O,T>, JpaCrossJoin<T>, JpaDerivedFrom<T>, JpaDerivedJoin<T>, JpaDerivedRoot<T>, JpaEntityJoin<T>, JpaFrom<O,T>, JpaJoin<O,T>, JpaJoinedFrom<O,T>, JpaListJoin<O,T>, JpaMapJoin<O,K,V>, JpaPluralJoin<O,C,E>, JpaRoot<T>, JpaSetJoin<O,T>, SqmAttributeJoin<O,T>, SqmCorrelation<O,T>, SqmFrom<O,T>, SqmJoin<O,T>, SqmPath<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 JpaPath<T> extends JpaExpression<T>, Path<T>
API extension to the JPA Path contract
Author:
Steve Ebersole
  • Method Details

    • getNavigablePath

      NavigablePath getNavigablePath()
      Get this path's NavigablePath
    • getLhs

      JpaPath<?> getLhs()
      The source (think "left hand side") of this path
    • treatAs

      <S extends T> JpaPath<S> treatAs(Class<S> treatJavaType)
      Support for JPA's explicit (TREAT) down-casting.
    • treatAs

      <S extends T> JpaPath<S> treatAs(EntityDomainType<S> treatJavaType)
      Support for JPA's explicit (TREAT) down-casting.
    • getParentPath

      default JpaPath<?> getParentPath()
      Description copied from interface: Path
      Return the parent "node" in the path or null if no parent.
      Specified by:
      getParentPath in interface Path<T>
      Returns:
      parent
    • get

      <Y> JpaPath<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 Path<T>
      Parameters:
      attribute - single-valued attribute
      Returns:
      path corresponding to the referenced attribute
    • get

      <E, C extends Collection<E>> JpaExpression<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 Path<T>
      Parameters:
      collection - collection-valued attribute
      Returns:
      expression corresponding to the referenced attribute
    • get

      <K, V, M extends Map<K, V>> JpaExpression<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 Path<T>
      Parameters:
      map - map-valued attribute
      Returns:
      expression corresponding to the referenced attribute
    • type

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

      <Y> JpaPath<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 Path<T>
      Parameters:
      attributeName - name of the attribute
      Returns:
      path corresponding to the referenced attribute