Class AbstractManagedType<J>
java.lang.Object
org.hibernate.metamodel.model.domain.AbstractDomainType<J>
org.hibernate.metamodel.model.domain.AbstractManagedType<J>
- All Implemented Interfaces:
ManagedType<J>,Type<J>,Serializable,DomainType<J>,AttributeContainer<J>,ManagedDomainType<J>,SimpleDomainType<J>,BindableType<J>,SqmExpressible<J>
- Direct Known Subclasses:
AbstractIdentifiableType,EmbeddableTypeImpl
public abstract class AbstractManagedType<J>
extends AbstractDomainType<J>
implements ManagedDomainType<J>, AttributeContainer<J>, Serializable
Functionality common to all implementations of
ManagedType.- Author:
- Steve Ebersole
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.hibernate.metamodel.model.domain.internal.AttributeContainer
AttributeContainer.InFlightAccess<J>Nested classes/interfaces inherited from interface jakarta.persistence.metamodel.Type
Type.PersistenceType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractManagedType(String hibernateTypeName, JavaType<J> javaType, ManagedDomainType<? super J> superType, JpaMetamodelImplementor metamodel) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubType(ManagedDomainType<? extends J> subType) protected AttributeContainer.InFlightAccess<J>PersistentAttribute<? super J,?> findAttribute(String name) PersistentAttribute<? super J,?> PersistentAttribute<? super J,?> findDeclaredAttribute(String name) PluralPersistentAttribute<? super J,?, ?> findPluralAttribute(String name) SingularPersistentAttribute<? super J,?> findSingularAttribute(String name) PersistentAttribute<?,?> findSubTypesAttribute(String name) PersistentAttribute<? super J,?> getAttribute(String name) Return the attribute of the managed type that corresponds to the specified name.Return the attributes of the managed type.BagPersistentAttribute<? super J,?> getCollection(String name) Return the Collection-valued attribute of the managed type that corresponds to the specified name.<E> BagPersistentAttribute<? super J,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<J,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.getDeclaredList(String name) Return the List-valued attribute declared by the managed type that corresponds to the specified name.<E> ListAttribute<J,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.MapPersistentAttribute<J,?, ?> getDeclaredMap(String name) Return the Map-valued attribute declared by the managed type that corresponds to the specified name.<K,V> MapAttribute<J, 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<J,?, ?>> Return all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) declared by the managed type.getDeclaredSet(String name) Return the Set-valued attribute declared by the managed type that corresponds to the specified name.<E> SetAttribute<J,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> SingularPersistentAttribute<J,Y> getDeclaredSingularAttribute(String name, Class<Y> javaType) Return the single-valued attribute declared by the managed type that corresponds to the specified name and Java type.Set<SingularAttribute<J,?>> Return the single-valued attributes declared by the managed type.ListPersistentAttribute<? super J,?> Return the List-valued attribute of the managed type that corresponds to the specified name.<E> ListAttribute<? super J,E> Return the List-valued attribute of the managed type that corresponds to the specified name and Java element type.MapPersistentAttribute<? super J,?, ?> Return the Map-valued attribute of the managed type that corresponds to the specified name.<K,V> MapAttribute<? super J, K, V> Return the Map-valued attribute of the managed type that corresponds to the specified name and Java key and value types.Set<PluralAttribute<? super J,?, ?>> Return all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) of the managed type.SetPersistentAttribute<? super J,?> Return the Set-valued attribute of the managed type that corresponds to the specified name.<E> SetAttribute<? super J,E> Return the Set-valued attribute of the managed type that corresponds to the specified name and Java element type.SingularPersistentAttribute<? super J,?> getSingularAttribute(String name) Return the single-valued attribute of the managed type that corresponds to the specified name.<Y> SingularPersistentAttribute<? super J,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 J,?>> Return the single-valued attributes of the managed type.Collection<? extends ManagedDomainType<? extends J>>ManagedDomainType<? super J>The descriptor of the supertype of this type.Get the type name.protected <Y> booleanisPrimitiveVariant(SingularAttribute<?, ?> attribute, Class<Y> javaType) toString()voidvisitAttributes(Consumer<? super PersistentAttribute<? super J, ?>> action) voidvisitDeclaredAttributes(Consumer<? super PersistentAttribute<J, ?>> action) protected ObjectMethods inherited from class org.hibernate.metamodel.model.domain.AbstractDomainType
getBindableJavaType, getExpressibleJavaType, getJavaTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.metamodel.model.domain.DomainType
getSqmType, getTupleLengthMethods inherited from interface org.hibernate.query.sqm.SqmExpressible
getExpressibleJavaType, getRelationalJavaType, isInstance, resolveExpressibleMethods inherited from interface jakarta.persistence.metamodel.Type
getJavaType, getPersistenceType
-
Constructor Details
-
AbstractManagedType
protected AbstractManagedType(String hibernateTypeName, JavaType<J> javaType, ManagedDomainType<? super J> superType, JpaMetamodelImplementor metamodel)
-
-
Method Details
-
createInFlightAccess
-
getSuperType
Description copied from interface:ManagedDomainTypeThe descriptor of the supertype of this type.- Specified by:
getSuperTypein interfaceManagedDomainType<J>
-
getSubTypes
- Specified by:
getSubTypesin interfaceManagedDomainType<J>
-
addSubType
- Specified by:
addSubTypein interfaceManagedDomainType<J>
-
getRepresentationMode
- Specified by:
getRepresentationModein interfaceManagedDomainType<J>
-
visitAttributes
- Specified by:
visitAttributesin interfaceManagedDomainType<J>
-
visitDeclaredAttributes
- Specified by:
visitDeclaredAttributesin interfaceManagedDomainType<J>
-
getAttributes
Description copied from interface:ManagedTypeReturn the attributes of the managed type.- Specified by:
getAttributesin interfaceManagedType<J>- 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<J>- Returns:
- declared attributes of the managed type
-
getAttribute
Description copied from interface:ManagedTypeReturn the attribute of the managed type that corresponds to the specified name.- Specified by:
getAttributein interfaceManagedDomainType<J>- Specified by:
getAttributein interfaceManagedType<J>- Parameters:
name- the name of the represented attribute- Returns:
- attribute with given name
-
findAttribute
- Specified by:
findAttributein interfaceManagedDomainType<J>
-
findAttributeInSuperTypes
- Specified by:
findAttributeInSuperTypesin interfaceManagedDomainType<J>
-
findSubTypesAttribute
- Specified by:
findSubTypesAttributein interfaceManagedDomainType<J>
-
findDeclaredAttribute
- Specified by:
findDeclaredAttributein interfaceManagedDomainType<J>
-
getDeclaredAttribute
Description copied from interface:ManagedTypeReturn the attribute declared by the managed type that corresponds to the specified name.- Specified by:
getDeclaredAttributein interfaceManagedDomainType<J>- Specified by:
getDeclaredAttributein interfaceManagedType<J>- Parameters:
name- the name of the represented attribute- Returns:
- attribute with given name
-
getTypeName
Description copied from interface:ManagedDomainTypeGet the type name.- Specified by:
getTypeNamein interfaceManagedDomainType<J>- Specified by:
getTypeNamein interfaceSqmExpressible<J>- Returns:
- The type name.
- See Also:
-
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<J>- 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<J>- Returns:
- declared single-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<J>- Parameters:
name- the name of the represented attribute- Returns:
- single-valued attribute with the given name
-
findSingularAttribute
- Specified by:
findSingularAttributein interfaceManagedDomainType<J>
-
getSingularAttribute
public <Y> SingularPersistentAttribute<? super J,Y> getSingularAttribute(String name, Class<Y> type) 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<J>- 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.- Specified by:
getDeclaredSingularAttributein interfaceManagedType<J>- Parameters:
name- the name of the represented attribute- Returns:
- declared single-valued attribute of the given name
-
findDeclaredSingularAttribute
- Specified by:
findDeclaredSingularAttributein interfaceManagedDomainType<J>
-
getDeclaredSingularAttribute
public <Y> SingularPersistentAttribute<J,Y> getDeclaredSingularAttribute(String name, Class<Y> javaType) 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<J>- Parameters:
name- the name of the represented attributejavaType- the type of the represented attribute- Returns:
- declared single-valued attribute of the given name and type
-
isPrimitiveVariant
-
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<J>- 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<J>- Returns:
- declared Collection-, Set-, List-, and Map-valued attributes
-
findPluralAttribute
- Specified by:
findPluralAttributein interfaceManagedDomainType<J>
-
findDeclaredPluralAttribute
- Specified by:
findDeclaredPluralAttributein interfaceManagedDomainType<J>
-
findConcreteGenericAttribute
- Specified by:
findConcreteGenericAttributein interfaceManagedDomainType<J>
-
findDeclaredConcreteGenericAttribute
- Specified by:
findDeclaredConcreteGenericAttributein interfaceManagedDomainType<J>
-
getCollection
Description copied from interface:ManagedTypeReturn the Collection-valued attribute of the managed type that corresponds to the specified name.- Specified by:
getCollectionin interfaceManagedType<J>- 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<J>- Parameters:
name- the name of the represented attribute- Returns:
- declared CollectionAttribute of the given name
-
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<J>- 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<J>- 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.- Specified by:
getSetin interfaceManagedType<J>- 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<J>- Parameters:
name- the name of the represented attribute- Returns:
- declared SetAttribute of the given name
-
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<J>- 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<J>- 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.- Specified by:
getListin interfaceManagedType<J>- 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<J>- Parameters:
name- the name of the represented attribute- Returns:
- declared ListAttribute of the given name
-
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<J>- 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<J>- 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.- Specified by:
getMapin interfaceManagedType<J>- 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<J>- Parameters:
name- the name of the represented attribute- Returns:
- declared MapAttribute of the given name
-
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<J>- 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<J>- 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
-
writeReplace
- Throws:
ObjectStreamException
-
getInFlightAccess
- Specified by:
getInFlightAccessin interfaceAttributeContainer<J>
-
toString
-