Interface SqmPathSource<J>

All Superinterfaces:
Bindable<J>, PathSource<J>, SqmExpressible<J>, SqmExpressibleAccessor<J>
All Known Subinterfaces:
SqmBagPersistentAttribute<D,E>, SqmEmbeddableDomainType<E>, SqmEntityDomainType<E>, SqmListPersistentAttribute<D,E>, SqmMappedSuperclassDomainType<T>, SqmMapPersistentAttribute<D,K,V>, SqmPluralPersistentAttribute<D,C,E>, SqmSetPersistentAttribute<D,E>, SqmSingularPersistentAttribute<D,J>, SqmTreatableDomainType<T>
All Known Implementing Classes:
org.hibernate.query.sqm.tuple.internal.AnonymousTupleType, SqmCteTable, SqmPolymorphicRootDescriptor

public interface SqmPathSource<J> extends SqmExpressible<J>, Bindable<J>, SqmExpressibleAccessor<J>, PathSource<J>
Represents any part of the domain model which can be used to create a SqmPath node.
API Note:
Parallel to the JPA-defined interface Bindable but broader mainly to support @Any mappings
  • Method Details

    • getPathType

      SqmDomainType<J> getPathType()
      The type of path this source creates.
      Specified by:
      getPathType in interface PathSource<J>
    • findSubPathSource

      @Nullable SqmPathSource<?> findSubPathSource(String name)
      Find a SqmPathSource by name relative to this source.
      Specified by:
      findSubPathSource in interface PathSource<J>
      Parameters:
      name - the name of the path source to find
      Returns:
      null if the subPathSource is not found
      Throws:
      IllegalStateException - to indicate that this source cannot be de-referenced
    • findSubPathSource

      default @Nullable SqmPathSource<?> findSubPathSource(String name, boolean includeSubtypes)
      Find a SqmPathSource by name relative to this source. If includeSubtypes is set to true and this path source is polymorphic, also try finding subtype attributes.
      Specified by:
      findSubPathSource in interface PathSource<J>
      Parameters:
      name - the name of the path source to find
      includeSubtypes - flag indicating whether to consider subtype attributes
      Returns:
      null if the subPathSource is not found
      Throws:
      IllegalStateException - to indicate that this source cannot be de-referenced
    • getSubPathSource

      default SqmPathSource<?> getSubPathSource(String name)
      Find a SqmPathSource by name relative to this source.
      Parameters:
      name - the name of the path source to find
      Throws:
      IllegalStateException - to indicate that this source cannot be de-referenced
      IllegalArgumentException - if the subPathSource is not found
    • getSubPathSource

      default SqmPathSource<?> getSubPathSource(String name, boolean subtypes)
      Find a SqmPathSource by name relative to this source. If subtypes is set to true and this path source is polymorphic, also try finding subtype attributes.
      Parameters:
      name - the name of the path source to find
      subtypes - flag indicating whether to consider subtype attributes
      Throws:
      IllegalStateException - to indicate that this source cannot be de-referenced
      IllegalArgumentException - if the subPathSource is not found
    • getIntermediatePathSource

      default @Nullable SqmPathSource<?> getIntermediatePathSource(SqmPathSource<?> pathSource)
      Returns the intermediate SqmPathSource for a path source previously acquired via findSubPathSource(String).
    • createSqmPath

      SqmPath<J> createSqmPath(SqmPath<?> lhs, @Nullable SqmPathSource<?> intermediatePathSource)
      Create an SQM path for this source relative to the given left hand side
    • getExpressible

      default @NonNull SqmBindableType<J> getExpressible()
      Specified by:
      getExpressible in interface SqmExpressibleAccessor<J>
    • getSqmType

      default @Nullable SqmDomainType<J> getSqmType()
      Specified by:
      getSqmType in interface SqmExpressible<J>
    • isGeneric

      default boolean isGeneric()
      Indicates if this path source is generically typed