Class SqmPolymorphicRootDescriptor<T>
java.lang.Object
org.hibernate.query.sqm.tree.domain.SqmPolymorphicRootDescriptor<T>
- All Implemented Interfaces:
Bindable<T>,EntityType<T>,IdentifiableType<T>,ManagedType<T>,Type<T>,DomainType<T>,EntityDomainType<T>,IdentifiableDomainType<T>,ManagedDomainType<T>,TreatableDomainType<T>,BindableType<T>,SqmExpressible<T>,SqmPathSource<T>,SqmExpressibleAccessor<T>
Acts as the
EntityDomainType for a "polymorphic query" grouping.- Author:
- Steve Ebersole
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.persistence.metamodel.Bindable
Bindable.BindableTypeNested classes/interfaces inherited from interface jakarta.persistence.metamodel.Type
Type.PersistenceType -
Constructor Summary
ConstructorsConstructorDescriptionSqmPolymorphicRootDescriptor(JavaType<T> polymorphicJavaType, Set<EntityDomainType<? extends T>> implementors) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubType(ManagedDomainType<? extends T> subType) createSqmPath(SqmPath<?> lhs, SqmPathSource<?> intermediatePathSource) Create an SQM path for this source relative to the given left hand sidePersistentAttribute<? super T,?> findAttribute(String name) PersistentAttribute<? super T,?> PersistentAttribute<? super T,?> findDeclaredAttribute(String name) SingularPersistentAttribute<? super T,?> List<? extends SingularPersistentAttribute<? super T,?>> PluralPersistentAttribute<? super T,?, ?> findPluralAttribute(String name) SingularPersistentAttribute<? super T,?> findSingularAttribute(String name) findSubPathSource(String name) Find aSqmPathSourceby name relative to this source.PersistentAttribute<?,?> findSubTypesAttribute(String name) SingularPersistentAttribute<? super T,?> PersistentAttribute<? super T,?> getAttribute(String name) Return the attribute of the managed type that corresponds to the specified name.Return the attributes of the managed type.The expected Java typeReturn the bindable type of the represented object.CollectionAttribute<? super T,?> getCollection(String name) Return the Collection-valued attribute of the managed type that corresponds to the specified name.<E> CollectionAttribute<? super T,E> getCollection(String name, Class<E> elementType) Return the Collection-valued attribute of the managed type that corresponds to the specified name and Java element type.getDeclaredAttribute(String name) Return the attribute declared by the managed type that corresponds to the specified name.Return the attributes declared by the managed type.getDeclaredCollection(String name) Return the Collection-valued attribute declared by the managed type that corresponds to the specified name.<E> CollectionAttribute<T,E> getDeclaredCollection(String name, Class<E> elementType) Return the Collection-valued attribute declared by the managed type that corresponds to the specified name and Java element type.<Y> SingularPersistentAttribute<T,Y> getDeclaredId(Class<Y> type) Return the attribute that corresponds to the id attribute declared by the entity or mapped superclass.ListAttribute<T,?> getDeclaredList(String name) Return the List-valued attribute declared by the managed type that corresponds to the specified name.<E> ListAttribute<T,E> getDeclaredList(String name, Class<E> elementType) Return the List-valued attribute declared by the managed type that corresponds to the specified name and Java element type.MapAttribute<T,?, ?> getDeclaredMap(String name) Return the Map-valued attribute declared by the managed type that corresponds to the specified name.<K,V> MapAttribute<T, K, V> getDeclaredMap(String name, Class<K> keyType, Class<V> valueType) Return the Map-valued attribute declared by the managed type that corresponds to the specified name and Java key and value types.Set<PluralAttribute<T,?, ?>> Return all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) declared by the managed type.SetAttribute<T,?> getDeclaredSet(String name) Return the Set-valued attribute declared by the managed type that corresponds to the specified name.<E> SetAttribute<T,E> getDeclaredSet(String name, Class<E> elementType) Return the Set-valued attribute declared by the managed type that corresponds to the specified name and Java element type.Return the single-valued attribute declared by the managed type that corresponds to the specified name.<Y> SingularAttribute<T,Y> getDeclaredSingularAttribute(String name, Class<Y> type) Return the single-valued attribute declared by the managed type that corresponds to the specified name and Java type.Set<SingularAttribute<T,?>> Return the single-valued attributes declared by the managed type.<Y> SingularPersistentAttribute<T,Y> getDeclaredVersion(Class<Y> type) Return the attribute that corresponds to the version attribute declared by the entity or mapped superclass.The Java type descriptor for this expressible<Y> SingularPersistentAttribute<? super T,Y> Return the attribute that corresponds to the id attribute of the entity or mapped superclass.Set<SingularAttribute<? super T,?>> Return the attributes corresponding to the id class of the identifiable type.Return the type that represents the type of the id.Set<EntityDomainType<? extends T>>Return the represented Java type.ListAttribute<? super T,?> Return the List-valued attribute of the managed type that corresponds to the specified name.<E> ListAttribute<? super T,E> Return the List-valued attribute of the managed type that corresponds to the specified name and Java element type.MapAttribute<? super T,?, ?> Return the Map-valued attribute of the managed type that corresponds to the specified name.<K,V> MapAttribute<? super T, K, V> Return the Map-valued attribute of the managed type that corresponds to the specified name and Java key and value types.getName()Return the entity name.The name of this thing.Return the persistence type.Set<PluralAttribute<? super T,?, ?>> Return all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) of the managed type.SetAttribute<? super T,?> Return the Set-valued attribute of the managed type that corresponds to the specified name.<E> SetAttribute<? super T,E> Return the Set-valued attribute of the managed type that corresponds to the specified name and Java element type.SingularAttribute<? super T,?> getSingularAttribute(String name) Return the single-valued attribute of the managed type that corresponds to the specified name.<Y> SingularAttribute<? super T,Y> getSingularAttribute(String name, Class<Y> type) Return the single-valued attribute of the managed type that corresponds to the specified name and Java type.Set<SingularAttribute<? super T,?>> Return the single-valued attributes of the managed type.The type of path this source creates.Collection<? extends EntityDomainType<? extends T>>IdentifiableDomainType<? super T>Return the identifiable type that corresponds to the most specific mapped superclass or entity extended by the entity or mapped superclass.ManagedDomainType<? super T>The descriptor of the supertype of this type.Get the type name.<Y> SingularPersistentAttribute<? super T,Y> getVersion(Class<Y> type) Return the attribute that corresponds to the version attribute of the entity or mapped superclass.booleanbooleanWhether the identifiable type has a single id attribute.booleanWhether the identifiable type has a version attribute.voidvisitAttributes(Consumer<? super PersistentAttribute<? super T, ?>> action) voidvisitDeclaredAttributes(Consumer<? super PersistentAttribute<T, ?>> action) voidvisitIdClassAttributes(Consumer<SingularPersistentAttribute<? super T, ?>> action) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.metamodel.model.domain.DomainType
getTupleLengthMethods inherited from interface org.hibernate.metamodel.model.domain.EntityDomainType
getSqmTypeMethods inherited from interface org.hibernate.query.sqm.SqmExpressible
getRelationalJavaType, isInstance, resolveExpressibleMethods inherited from interface org.hibernate.query.sqm.tree.SqmExpressibleAccessor
getNodeJavaTypeMethods inherited from interface org.hibernate.query.sqm.SqmPathSource
findSubPathSource, getExpressible, getIntermediatePathSource, getSubPathSource, getSubPathSource, isGeneric
-
Constructor Details
-
SqmPolymorphicRootDescriptor
public SqmPolymorphicRootDescriptor(JavaType<T> polymorphicJavaType, Set<EntityDomainType<? extends T>> implementors)
-
-
Method Details
-
getImplementors
-
getName
Description copied from interface:EntityTypeReturn the entity name.- Specified by:
getNamein interfaceEntityType<T>- Returns:
- entity name
-
getHibernateEntityName
- Specified by:
getHibernateEntityNamein interfaceEntityDomainType<T>
-
getTypeName
Description copied from interface:ManagedDomainTypeGet the type name.- Specified by:
getTypeNamein interfaceManagedDomainType<T>- Specified by:
getTypeNamein interfaceSqmExpressible<T>- Returns:
- The type name.
- See Also:
-
getPathName
Description copied from interface:SqmPathSourceThe name of this thing.- Specified by:
getPathNamein interfaceSqmPathSource<T>
-
getSqmPathType
Description copied from interface:SqmPathSourceThe type of path this source creates.- Specified by:
getSqmPathTypein interfaceSqmPathSource<T>
-
getBindableType
Description copied from interface:BindableReturn the bindable type of the represented object.- Specified by:
getBindableTypein interfaceBindable<T>- Returns:
- bindable type
-
getBindableJavaType
Description copied from interface:BindableTypeThe expected Java type- Specified by:
getBindableJavaTypein interfaceBindable<T>- Specified by:
getBindableJavaTypein interfaceBindableType<T>- Returns:
- Java type
-
getPersistenceType
Description copied from interface:TypeReturn the persistence type.- Specified by:
getPersistenceTypein interfaceType<T>- Returns:
- persistence type
-
getJavaType
Description copied from interface:TypeReturn the represented Java type.- Specified by:
getJavaTypein interfaceType<T>- Returns:
- Java type
-
getExpressibleJavaType
Description copied from interface:SqmExpressibleThe Java type descriptor for this expressible- Specified by:
getExpressibleJavaTypein interfaceSqmExpressible<T>
-
findAttribute
- Specified by:
findAttributein interfaceManagedDomainType<T>
-
findSubTypesAttribute
- Specified by:
findSubTypesAttributein interfaceManagedDomainType<T>
-
findAttributeInSuperTypes
- Specified by:
findAttributeInSuperTypesin interfaceManagedDomainType<T>
-
visitAttributes
- Specified by:
visitAttributesin interfaceManagedDomainType<T>
-
visitDeclaredAttributes
- Specified by:
visitDeclaredAttributesin interfaceManagedDomainType<T>
-
getAttribute
Description copied from interface:ManagedTypeReturn the attribute of the managed type that corresponds to the specified name.- Specified by:
getAttributein interfaceManagedDomainType<T>- Specified by:
getAttributein interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- attribute with given name
-
getDeclaredAttribute
Description copied from interface:ManagedTypeReturn the attribute declared by the managed type that corresponds to the specified name.- Specified by:
getDeclaredAttributein interfaceManagedDomainType<T>- Specified by:
getDeclaredAttributein interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- attribute with given name
-
findSingularAttribute
- Specified by:
findSingularAttributein interfaceManagedDomainType<T>
-
findPluralAttribute
- Specified by:
findPluralAttributein interfaceManagedDomainType<T>
-
findConcreteGenericAttribute
- Specified by:
findConcreteGenericAttributein interfaceManagedDomainType<T>
-
findDeclaredAttribute
- Specified by:
findDeclaredAttributein interfaceManagedDomainType<T>
-
findDeclaredSingularAttribute
- Specified by:
findDeclaredSingularAttributein interfaceManagedDomainType<T>
-
findDeclaredPluralAttribute
- Specified by:
findDeclaredPluralAttributein interfaceManagedDomainType<T>
-
findDeclaredConcreteGenericAttribute
- Specified by:
findDeclaredConcreteGenericAttributein interfaceManagedDomainType<T>
-
getAttributes
Description copied from interface:ManagedTypeReturn the attributes of the managed type.- Specified by:
getAttributesin interfaceManagedType<T>- Returns:
- attributes of the managed type
-
getDeclaredAttributes
Description copied from interface:ManagedTypeReturn the attributes declared by the managed type. Returns empty set if the managed type has no declared attributes.- Specified by:
getDeclaredAttributesin interfaceManagedType<T>- Returns:
- declared attributes of the managed type
-
getSingularAttribute
Description copied from interface:ManagedTypeReturn the single-valued attribute of the managed type that corresponds to the specified name and Java type.- Specified by:
getSingularAttributein interfaceManagedType<T>- Parameters:
name- the name of the represented attributetype- the type of the represented attribute- Returns:
- single-valued attribute with given name and type
-
getDeclaredSingularAttribute
Description copied from interface:ManagedTypeReturn the single-valued attribute declared by the managed type that corresponds to the specified name and Java type.- Specified by:
getDeclaredSingularAttributein interfaceManagedType<T>- Parameters:
name- the name of the represented attributetype- the type of the represented attribute- Returns:
- declared single-valued attribute of the given name and type
-
getSingularAttributes
Description copied from interface:ManagedTypeReturn the single-valued attributes of the managed type. Returns empty set if the managed type has no single-valued attributes.- Specified by:
getSingularAttributesin interfaceManagedType<T>- Returns:
- single-valued attributes
-
getDeclaredSingularAttributes
Description copied from interface:ManagedTypeReturn the single-valued attributes declared by the managed type. Returns empty set if the managed type has no declared single-valued attributes.- Specified by:
getDeclaredSingularAttributesin interfaceManagedType<T>- Returns:
- declared single-valued attributes
-
getCollection
Description copied from interface:ManagedTypeReturn the Collection-valued attribute of the managed type that corresponds to the specified name and Java element type.- Specified by:
getCollectionin interfaceManagedType<T>- Parameters:
name- the name of the represented attributeelementType- the element type of the represented attribute- Returns:
- CollectionAttribute of the given name and element type
-
getDeclaredCollection
Description copied from interface:ManagedTypeReturn the Collection-valued attribute declared by the managed type that corresponds to the specified name and Java element type.- Specified by:
getDeclaredCollectionin interfaceManagedType<T>- Parameters:
name- the name of the represented attributeelementType- the element type of the represented attribute- Returns:
- declared
CollectionAttributeof the given name and element type
-
getSet
Description copied from interface:ManagedTypeReturn the Set-valued attribute of the managed type that corresponds to the specified name and Java element type.- Specified by:
getSetin interfaceManagedType<T>- Parameters:
name- the name of the represented attributeelementType- the element type of the represented attribute- Returns:
- SetAttribute of the given name and element type
-
getDeclaredSet
Description copied from interface:ManagedTypeReturn the Set-valued attribute declared by the managed type that corresponds to the specified name and Java element type.- Specified by:
getDeclaredSetin interfaceManagedType<T>- Parameters:
name- the name of the represented attributeelementType- the element type of the represented attribute- Returns:
- declared SetAttribute of the given name and element type
-
getList
Description copied from interface:ManagedTypeReturn the List-valued attribute of the managed type that corresponds to the specified name and Java element type.- Specified by:
getListin interfaceManagedType<T>- Parameters:
name- the name of the represented attributeelementType- the element type of the represented attribute- Returns:
- ListAttribute of the given name and element type
-
getDeclaredList
Description copied from interface:ManagedTypeReturn the List-valued attribute declared by the managed type that corresponds to the specified name and Java element type.- Specified by:
getDeclaredListin interfaceManagedType<T>- Parameters:
name- the name of the represented attributeelementType- the element type of the represented attribute- Returns:
- declared ListAttribute of the given name and element type
-
getMap
Description copied from interface:ManagedTypeReturn the Map-valued attribute of the managed type that corresponds to the specified name and Java key and value types.- Specified by:
getMapin interfaceManagedType<T>- Parameters:
name- the name of the represented attributekeyType- the key type of the represented attributevalueType- the value type of the represented attribute- Returns:
- MapAttribute of the given name and key and value types
-
getDeclaredMap
Description copied from interface:ManagedTypeReturn the Map-valued attribute declared by the managed type that corresponds to the specified name and Java key and value types.- Specified by:
getDeclaredMapin interfaceManagedType<T>- Parameters:
name- the name of the represented attributekeyType- the key type of the represented attributevalueType- the value type of the represented attribute- Returns:
- declared MapAttribute of the given name and key and value types
-
getPluralAttributes
Description copied from interface:ManagedTypeReturn all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) of the managed type. Returns empty set if the managed type has no multi-valued attributes.- Specified by:
getPluralAttributesin interfaceManagedType<T>- Returns:
- Collection-, Set-, List-, and Map-valued attributes
-
getDeclaredPluralAttributes
Description copied from interface:ManagedTypeReturn all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) declared by the managed type. Returns empty set if the managed type has no declared multi-valued attributes.- Specified by:
getDeclaredPluralAttributesin interfaceManagedType<T>- Returns:
- declared Collection-, Set-, List-, and Map-valued attributes
-
getSingularAttribute
Description copied from interface:ManagedTypeReturn the single-valued attribute of the managed type that corresponds to the specified name.- Specified by:
getSingularAttributein interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- single-valued attribute with the given name
-
getDeclaredSingularAttribute
Description copied from interface:ManagedTypeReturn the single-valued attribute declared by the managed type that corresponds to the specified name.- Specified by:
getDeclaredSingularAttributein interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- declared single-valued attribute of the given name
-
getCollection
Description copied from interface:ManagedTypeReturn the Collection-valued attribute of the managed type that corresponds to the specified name.- Specified by:
getCollectionin interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- CollectionAttribute of the given name
-
getDeclaredCollection
Description copied from interface:ManagedTypeReturn the Collection-valued attribute declared by the managed type that corresponds to the specified name.- Specified by:
getDeclaredCollectionin interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- declared CollectionAttribute of the given name
-
getSet
Description copied from interface:ManagedTypeReturn the Set-valued attribute of the managed type that corresponds to the specified name.- Specified by:
getSetin interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- SetAttribute of the given name
-
getDeclaredSet
Description copied from interface:ManagedTypeReturn the Set-valued attribute declared by the managed type that corresponds to the specified name.- Specified by:
getDeclaredSetin interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- declared SetAttribute of the given name
-
getList
Description copied from interface:ManagedTypeReturn the List-valued attribute of the managed type that corresponds to the specified name.- Specified by:
getListin interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- ListAttribute of the given name
-
getDeclaredList
Description copied from interface:ManagedTypeReturn the List-valued attribute declared by the managed type that corresponds to the specified name.- Specified by:
getDeclaredListin interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- declared ListAttribute of the given name
-
getMap
Description copied from interface:ManagedTypeReturn the Map-valued attribute of the managed type that corresponds to the specified name.- Specified by:
getMapin interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- MapAttribute of the given name
-
getDeclaredMap
Description copied from interface:ManagedTypeReturn the Map-valued attribute declared by the managed type that corresponds to the specified name.- Specified by:
getDeclaredMapin interfaceManagedType<T>- Parameters:
name- the name of the represented attribute- Returns:
- declared MapAttribute of the given name
-
findSubPathSource
Description copied from interface:SqmPathSourceFind aSqmPathSourceby name relative to this source.- Specified by:
findSubPathSourcein interfaceSqmPathSource<T>- Returns:
- null if the subPathSource is not found
-
createSqmPath
Description copied from interface:SqmPathSourceCreate an SQM path for this source relative to the given left hand side- Specified by:
createSqmPathin interfaceSqmPathSource<T>
-
getRepresentationMode
- Specified by:
getRepresentationModein interfaceManagedDomainType<T>
-
getIdentifierDescriptor
- Specified by:
getIdentifierDescriptorin interfaceIdentifiableDomainType<T>
-
getId
Description copied from interface:IdentifiableTypeReturn the attribute that corresponds to the id attribute of the entity or mapped superclass.- Specified by:
getIdin interfaceIdentifiableDomainType<T>- Specified by:
getIdin interfaceIdentifiableType<T>- Parameters:
type- the type of the represented id attribute- Returns:
- id attribute
-
getDeclaredId
Description copied from interface:IdentifiableTypeReturn the attribute that corresponds to the id attribute declared by the entity or mapped superclass.- Specified by:
getDeclaredIdin interfaceIdentifiableDomainType<T>- Specified by:
getDeclaredIdin interfaceIdentifiableType<T>- Parameters:
type- the type of the represented declared id attribute- Returns:
- declared id attribute
-
getVersion
Description copied from interface:IdentifiableTypeReturn the attribute that corresponds to the version attribute of the entity or mapped superclass.- Specified by:
getVersionin interfaceIdentifiableDomainType<T>- Specified by:
getVersionin interfaceIdentifiableType<T>- Parameters:
type- the type of the represented version attribute- Returns:
- version attribute
-
getDeclaredVersion
Description copied from interface:IdentifiableTypeReturn the attribute that corresponds to the version attribute declared by the entity or mapped superclass.- Specified by:
getDeclaredVersionin interfaceIdentifiableDomainType<T>- Specified by:
getDeclaredVersionin interfaceIdentifiableType<T>- Parameters:
type- the type of the represented declared version attribute- Returns:
- declared version attribute
-
getIdClassAttributes
Description copied from interface:IdentifiableTypeReturn the attributes corresponding to the id class of the identifiable type.- Specified by:
getIdClassAttributesin interfaceIdentifiableDomainType<T>- Specified by:
getIdClassAttributesin interfaceIdentifiableType<T>- Returns:
- id attributes
-
getIdType
Description copied from interface:IdentifiableTypeReturn the type that represents the type of the id.- Specified by:
getIdTypein interfaceIdentifiableDomainType<T>- Specified by:
getIdTypein interfaceIdentifiableType<T>- Returns:
- type of id
-
getSupertype
Description copied from interface:IdentifiableTypeReturn the identifiable type that corresponds to the most specific mapped superclass or entity extended by the entity or mapped superclass.- Specified by:
getSupertypein interfaceIdentifiableDomainType<T>- Specified by:
getSupertypein interfaceIdentifiableType<T>- Returns:
- supertype of identifiable type or null if no such supertype
-
hasIdClass
public boolean hasIdClass()- Specified by:
hasIdClassin interfaceIdentifiableDomainType<T>
-
findIdAttribute
- Specified by:
findIdAttributein interfaceIdentifiableDomainType<T>
-
visitIdClassAttributes
- Specified by:
visitIdClassAttributesin interfaceIdentifiableDomainType<T>
-
findVersionAttribute
- Specified by:
findVersionAttributein interfaceIdentifiableDomainType<T>
-
findNaturalIdAttributes
- Specified by:
findNaturalIdAttributesin interfaceIdentifiableDomainType<T>
-
hasSingleIdAttribute
public boolean hasSingleIdAttribute()Description copied from interface:IdentifiableTypeWhether the identifiable type has a single id attribute. Returns true for a simple id or embedded id; returns false for an idclass.- Specified by:
hasSingleIdAttributein interfaceIdentifiableType<T>- Returns:
- boolean indicating whether the identifiable type has a single id attribute
-
hasVersionAttribute
public boolean hasVersionAttribute()Description copied from interface:IdentifiableTypeWhether the identifiable type has a version attribute.- Specified by:
hasVersionAttributein interfaceIdentifiableType<T>- Returns:
- boolean indicating whether the identifiable type has a version attribute
-
getSuperType
Description copied from interface:ManagedDomainTypeThe descriptor of the supertype of this type.- Specified by:
getSuperTypein interfaceManagedDomainType<T>
-
getSubTypes
- Specified by:
getSubTypesin interfaceEntityDomainType<T>- Specified by:
getSubTypesin interfaceManagedDomainType<T>
-
addSubType
- Specified by:
addSubTypein interfaceManagedDomainType<T>
-