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
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
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidapplyInferableType(@Nullable SqmExpressible<?> type) Used to apply type information based on the expression's usage within the query.copy(SqmCopyContext context) default SqmRoot<?>findRoot()<K,V, M extends Map<K, V>>
SqmExpression<M>get(MapAttribute<T, K, V> map) Create a path corresponding to the referenced map-valued attribute.<E,C extends Collection<E>>
SqmExpression<C>get(PluralAttribute<T, C, E> collection) Create a path corresponding to the referenced collection-valued attribute.<Y> SqmPath<Y>get(SingularAttribute<? super T, Y> attribute) Create a path corresponding to the referenced single-valued attribute.<Y> SqmPath<Y>Create a path corresponding to the referenced attribute.Retrieve the explicit alias, if one.SqmPath<?>getLhs()Get the left-hand side of this path - may be null, indicating a root, cross-join or entity-joinReturns the NavigablePath.This node's type is its "referenced path source"The path source that this path refers to (and that most likely created it).Get this path's actual resolved model, i.e. the concrete type for generic attributes.SqmPath<?>getReusablePath(String name) Returns an immutable List of reusable pathsvoidregisterReusablePath(SqmPath<?> path) Register a reusable path relative to this pathdefault StringRetrieve the explicit alias, if one, otherwise return a generated one and set that as explicit alias.default SqmPath<?>resolveIndexedAccess(SqmExpression<?> selector, boolean isTerminal, SqmCreationState creationState) SqmPath<?>resolvePathPart(String name, boolean isTerminal, SqmCreationState creationState) voidsetExplicitAlias(String explicitAlias) Set the explicit alias for this pathSupport for JPA's explicit (TREAT) down-casting.treatAs(EntityDomainType<S> treatTarget) Support for JPA's explicit (TREAT) down-casting.SqmExpression<Class<? extends T>>type()Create an expression corresponding to the type of the path.voidvisitReusablePaths(Consumer<SqmPath<?>> consumer) Visit each reusable path relative to this pathMethods inherited from interface org.hibernate.query.criteria.JpaPath
getParentPathMethods inherited from interface org.hibernate.query.criteria.JpaSelection
alias, getCompoundSelectionItems, getSelectionItemsMethods inherited from interface org.hibernate.query.criteria.JpaTupleElement
getJavaType, getJavaTypeName, isEnumMethods inherited from interface jakarta.persistence.criteria.Selection
isCompoundSelectionMethods inherited from interface org.hibernate.query.sqm.tree.expression.SqmExpression
as, asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, cast, castAs, equalTo, equalTo, in, in, in, in, isNotNull, isNull, visitSubSelectableNodesMethods inherited from interface org.hibernate.query.sqm.tree.SqmNode
asLoggableText, nodeBuilderMethods inherited from interface org.hibernate.query.sqm.tree.select.SqmSelectableNode
getTupleLengthMethods inherited from interface org.hibernate.query.sqm.tree.SqmTypedNode
getExpressible, getNodeJavaTypeMethods inherited from interface org.hibernate.query.sqm.tree.SqmVisitableNode
accept, appendHqlString, toHqlStringMethods inherited from interface jakarta.persistence.TupleElement
getAlias
-
Method Details
-
getReferencedPathSource
SqmPathSource<?> getReferencedPathSource()The path source that this path refers to (and that most likely created it). -
getExplicitAlias
String getExplicitAlias()Retrieve the explicit alias, if one. May return null -
setExplicitAlias
Set the explicit alias for this path -
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 -
getReusablePaths
Returns an immutable List of reusable paths -
visitReusablePaths
Visit each reusable path relative to this path -
registerReusablePath
Register a reusable path relative to this path -
getReusablePath
-
getNodeType
SqmPathSource<T> getNodeType()This node's type is its "referenced path source"- Specified by:
getNodeTypein interfaceSqmExpression<T>- Specified by:
getNodeTypein interfaceSqmTypedNode<T>
-
applyInferableType
Description copied from interface:SqmExpressionUsed to apply type information based on the expression's usage within the query.- Specified by:
applyInferableTypein interfaceSqmExpression<T>
-
getJavaTypeDescriptor
- Specified by:
getJavaTypeDescriptorin interfaceJpaTupleElement<T>
-
treatAs
Description copied from interface:JpaPathSupport for JPA's explicit (TREAT) down-casting. -
treatAs
Description copied from interface:JpaPathSupport for JPA's explicit (TREAT) down-casting. -
findRoot
-
resolvePathPart
- Specified by:
resolvePathPartin interfaceSemanticPathPart
-
resolveIndexedAccess
default SqmPath<?> resolveIndexedAccess(SqmExpression<?> selector, boolean isTerminal, SqmCreationState creationState) - Specified by:
resolveIndexedAccessin interfaceSemanticPathPart
-
getResolvedModel
SqmPathSource<?> getResolvedModel()Get this path's actual resolved model, i.e. the concrete type for generic attributes. -
get
Description copied from interface:PathCreate a path corresponding to the referenced single-valued attribute. -
get
Description copied from interface:PathCreate a path corresponding to the referenced collection-valued attribute. -
get
Description copied from interface:PathCreate a path corresponding to the referenced map-valued attribute. -
type
SqmExpression<Class<? extends T>> type()Description copied from interface:PathCreate an expression corresponding to the type of the path. -
get
Description copied from interface:PathCreate a path corresponding to the referenced attribute.Note: Applications using the string-based API may need to specify the type resulting from the
getoperation in order to avoid the use ofPathvariables.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)); -
copy
- Specified by:
copyin interfaceSqmExpression<T>- Specified by:
copyin interfaceSqmNode- Specified by:
copyin interfaceSqmSelectableNode<T>- Specified by:
copyin interfaceSqmTypedNode<T>