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
Commonality for Hibernate's implementations of the JPAManagedType
contract.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractManagedType.InFlightAccessImpl
-
Nested 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
Constructors Modifier Constructor Description protected
AbstractManagedType(String hibernateTypeName, JavaType<J> javaType, ManagedDomainType<? super J> superType, JpaMetamodelImplementor domainMetamodel)
-
Method Summary
-
Methods inherited from class org.hibernate.metamodel.model.domain.AbstractDomainType
getBindableJavaType, getExpressibleJavaType, getJavaType, jpaMetamodel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.metamodel.model.domain.DomainType
getExpressibleJavaType
-
Methods inherited from interface org.hibernate.metamodel.model.domain.ManagedDomainType
makeSubGraph
-
Methods inherited from interface org.hibernate.query.sqm.SqmExpressible
getRelationalJavaType, isInstance, resolveExpressible
-
Methods inherited from interface jakarta.persistence.metamodel.Type
getJavaType, getPersistenceType
-
-
-
-
Constructor Detail
-
AbstractManagedType
protected AbstractManagedType(String hibernateTypeName, JavaType<J> javaType, ManagedDomainType<? super J> superType, JpaMetamodelImplementor domainMetamodel)
-
-
Method Detail
-
createInFlightAccess
protected AttributeContainer.InFlightAccess<J> createInFlightAccess()
-
getSuperType
public ManagedDomainType<? super J> getSuperType()
Description copied from interface:ManagedDomainType
This type's super type descriptor. Note : we define this on the managed type descriptor in anticipation of supporting embeddable inheritance- Specified by:
getSuperType
in interfaceManagedDomainType<J>
-
getSubTypes
public Collection<? extends ManagedDomainType<? extends J>> getSubTypes()
- Specified by:
getSubTypes
in interfaceManagedDomainType<J>
-
addSubType
public void addSubType(ManagedDomainType subType)
- Specified by:
addSubType
in interfaceManagedDomainType<J>
-
getRepresentationMode
public RepresentationMode getRepresentationMode()
- Specified by:
getRepresentationMode
in interfaceManagedDomainType<J>
-
visitAttributes
public void visitAttributes(Consumer<? super PersistentAttribute<J,?>> action)
- Specified by:
visitAttributes
in interfaceManagedDomainType<J>
-
visitDeclaredAttributes
public void visitDeclaredAttributes(Consumer<? super PersistentAttribute<J,?>> action)
- Specified by:
visitDeclaredAttributes
in interfaceManagedDomainType<J>
-
getAttributes
public Set<Attribute<? super J,?>> getAttributes()
- Specified by:
getAttributes
in interfaceManagedType<J>
-
getDeclaredAttributes
public Set<Attribute<J,?>> getDeclaredAttributes()
- Specified by:
getDeclaredAttributes
in interfaceManagedType<J>
-
getAttribute
public PersistentAttribute<? super J,?> getAttribute(String name)
- Specified by:
getAttribute
in interfaceManagedDomainType<J>
- Specified by:
getAttribute
in interfaceManagedType<J>
-
findAttribute
public PersistentAttribute<? super J,?> findAttribute(String name)
- Specified by:
findAttribute
in interfaceManagedDomainType<J>
-
findAttributeInSuperTypes
public PersistentAttribute<? super J,?> findAttributeInSuperTypes(String name)
- Specified by:
findAttributeInSuperTypes
in interfaceManagedDomainType<J>
-
findSubTypesAttribute
public PersistentAttribute<? super J,?> findSubTypesAttribute(String name)
- Specified by:
findSubTypesAttribute
in interfaceManagedDomainType<J>
-
findDeclaredAttribute
public PersistentAttribute<J,?> findDeclaredAttribute(String name)
- Specified by:
findDeclaredAttribute
in interfaceManagedDomainType<J>
-
getDeclaredAttribute
public PersistentAttribute<J,?> getDeclaredAttribute(String name)
- Specified by:
getDeclaredAttribute
in interfaceManagedDomainType<J>
- Specified by:
getDeclaredAttribute
in interfaceManagedType<J>
-
getTypeName
public String getTypeName()
Description copied from interface:ManagedDomainType
Get the type name. Generally speaking, this returns the name of the Java class. However, for dynamic models (RepresentationMode.MAP
), this returns the symbolic name since the Java type isMap
- Specified by:
getTypeName
in interfaceDomainType<J>
- Specified by:
getTypeName
in interfaceManagedDomainType<J>
- Returns:
- The type name.
- See Also:
ManagedDomainType.getRepresentationMode()
-
getSingularAttributes
public Set<SingularAttribute<? super J,?>> getSingularAttributes()
- Specified by:
getSingularAttributes
in interfaceManagedType<J>
-
getDeclaredSingularAttributes
public Set<SingularAttribute<J,?>> getDeclaredSingularAttributes()
- Specified by:
getDeclaredSingularAttributes
in interfaceManagedType<J>
-
getSingularAttribute
public SingularPersistentAttribute<? super J,?> getSingularAttribute(String name)
- Specified by:
getSingularAttribute
in interfaceManagedType<J>
-
findSingularAttribute
public SingularPersistentAttribute<? super J,?> findSingularAttribute(String name)
- Specified by:
findSingularAttribute
in interfaceManagedDomainType<J>
-
getSingularAttribute
public <Y> SingularPersistentAttribute<? super J,Y> getSingularAttribute(String name, Class<Y> type)
- Specified by:
getSingularAttribute
in interfaceManagedType<J>
-
getDeclaredSingularAttribute
public SingularAttribute<J,?> getDeclaredSingularAttribute(String name)
- Specified by:
getDeclaredSingularAttribute
in interfaceManagedType<J>
-
findDeclaredSingularAttribute
public SingularPersistentAttribute<? super J,?> findDeclaredSingularAttribute(String name)
- Specified by:
findDeclaredSingularAttribute
in interfaceManagedDomainType<J>
-
getDeclaredSingularAttribute
public <Y> SingularPersistentAttribute<J,Y> getDeclaredSingularAttribute(String name, Class<Y> javaType)
- Specified by:
getDeclaredSingularAttribute
in interfaceManagedType<J>
-
isPrimitiveVariant
protected <Y> boolean isPrimitiveVariant(SingularAttribute<?,?> attribute, Class<Y> javaType)
-
getPluralAttributes
public Set<PluralAttribute<? super J,?,?>> getPluralAttributes()
- Specified by:
getPluralAttributes
in interfaceManagedType<J>
-
getDeclaredPluralAttributes
public Set<PluralAttribute<J,?,?>> getDeclaredPluralAttributes()
- Specified by:
getDeclaredPluralAttributes
in interfaceManagedType<J>
-
findPluralAttribute
public PluralPersistentAttribute<? super J,?,?> findPluralAttribute(String name)
- Specified by:
findPluralAttribute
in interfaceManagedDomainType<J>
-
findDeclaredPluralAttribute
public PluralPersistentAttribute<? super J,?,?> findDeclaredPluralAttribute(String name)
- Specified by:
findDeclaredPluralAttribute
in interfaceManagedDomainType<J>
-
findConcreteGenericAttribute
public PersistentAttribute<? super J,?> findConcreteGenericAttribute(String name)
- Specified by:
findConcreteGenericAttribute
in interfaceManagedDomainType<J>
-
findDeclaredConcreteGenericAttribute
public PersistentAttribute<? super J,?> findDeclaredConcreteGenericAttribute(String name)
- Specified by:
findDeclaredConcreteGenericAttribute
in interfaceManagedDomainType<J>
-
getCollection
public BagPersistentAttribute<? super J,?> getCollection(String name)
- Specified by:
getCollection
in interfaceManagedType<J>
-
getDeclaredCollection
public CollectionAttribute<J,?> getDeclaredCollection(String name)
- Specified by:
getDeclaredCollection
in interfaceManagedType<J>
-
getCollection
public <E> BagPersistentAttribute<? super J,E> getCollection(String name, Class<E> elementType)
- Specified by:
getCollection
in interfaceManagedType<J>
-
getDeclaredCollection
public <E> CollectionAttribute<J,E> getDeclaredCollection(String name, Class<E> elementType)
- Specified by:
getDeclaredCollection
in interfaceManagedType<J>
-
getSet
public SetPersistentAttribute<? super J,?> getSet(String name)
- Specified by:
getSet
in interfaceManagedType<J>
-
getDeclaredSet
public SetPersistentAttribute<J,?> getDeclaredSet(String name)
- Specified by:
getDeclaredSet
in interfaceManagedType<J>
-
getSet
public <E> SetAttribute<? super J,E> getSet(String name, Class<E> elementType)
- Specified by:
getSet
in interfaceManagedType<J>
-
getDeclaredSet
public <E> SetAttribute<J,E> getDeclaredSet(String name, Class<E> elementType)
- Specified by:
getDeclaredSet
in interfaceManagedType<J>
-
getList
public ListPersistentAttribute<? super J,?> getList(String name)
- Specified by:
getList
in interfaceManagedType<J>
-
getDeclaredList
public ListPersistentAttribute<J,?> getDeclaredList(String name)
- Specified by:
getDeclaredList
in interfaceManagedType<J>
-
getList
public <E> ListAttribute<? super J,E> getList(String name, Class<E> elementType)
- Specified by:
getList
in interfaceManagedType<J>
-
getDeclaredList
public <E> ListAttribute<J,E> getDeclaredList(String name, Class<E> elementType)
- Specified by:
getDeclaredList
in interfaceManagedType<J>
-
getMap
public MapPersistentAttribute<? super J,?,?> getMap(String name)
- Specified by:
getMap
in interfaceManagedType<J>
-
getDeclaredMap
public MapPersistentAttribute<J,?,?> getDeclaredMap(String name)
- Specified by:
getDeclaredMap
in interfaceManagedType<J>
-
getMap
public <K,V> MapAttribute<? super J,K,V> getMap(String name, Class<K> keyType, Class<V> valueType)
- Specified by:
getMap
in interfaceManagedType<J>
-
getDeclaredMap
public <K,V> MapAttribute<J,K,V> getDeclaredMap(String name, Class<K> keyType, Class<V> valueType)
- Specified by:
getDeclaredMap
in interfaceManagedType<J>
-
makeSubGraph
public SubGraphImplementor<J> makeSubGraph()
- Specified by:
makeSubGraph
in interfaceManagedDomainType<J>
-
findSubType
public <S extends J> ManagedDomainType<S> findSubType(String subTypeName)
- Specified by:
findSubType
in interfaceManagedDomainType<J>
-
findSubType
public <S extends J> ManagedDomainType<S> findSubType(Class<S> subType)
- Specified by:
findSubType
in interfaceManagedDomainType<J>
-
writeReplace
protected Object writeReplace() throws ObjectStreamException
- Throws:
ObjectStreamException
-
getInFlightAccess
public AttributeContainer.InFlightAccess<J> getInFlightAccess()
- Specified by:
getInFlightAccess
in interfaceAttributeContainer<J>
-
-