Class AbstractIdentifiableType<J>
- java.lang.Object
-
- org.hibernate.metamodel.model.domain.AbstractDomainType<J>
-
- org.hibernate.metamodel.model.domain.AbstractManagedType<J>
-
- org.hibernate.metamodel.model.domain.AbstractIdentifiableType<J>
-
- All Implemented Interfaces:
IdentifiableType<J>
,ManagedType<J>
,Type<J>
,Serializable
,DomainType<J>
,IdentifiableDomainType<J>
,AttributeContainer<J>
,ManagedDomainType<J>
,SimpleDomainType<J>
,BindableType<J>
,SqmExpressible<J>
- Direct Known Subclasses:
EntityTypeImpl
,MappedSuperclassTypeImpl
public abstract class AbstractIdentifiableType<J> extends AbstractManagedType<J> implements IdentifiableDomainType<J>, Serializable
Functionality common to all implementations ofIdentifiableType
.An identifiable type is one which may have an identifier attribute, that is, an entity type or a mapped superclass.
- See Also:
- Serialized Form
- API Note:
- Currently we only really have support for direct entities in the Hibernate metamodel as the information for them is consumed into the closest actual entity subclass(es) in the internal Hibernate mapping metamodel.
-
-
Nested Class Summary
-
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 Constructor Description AbstractIdentifiableType(String typeName, JavaType<J> javaType, IdentifiableDomainType<? super J> superType, boolean hasIdClass, boolean hasIdentifierProperty, boolean versioned, JpaMetamodelImplementor metamodel)
-
Method Summary
-
Methods inherited from class org.hibernate.metamodel.model.domain.AbstractManagedType
addSubType, findAttribute, findAttributeInSuperTypes, findConcreteGenericAttribute, findDeclaredAttribute, findDeclaredConcreteGenericAttribute, findDeclaredPluralAttribute, findDeclaredSingularAttribute, findPluralAttribute, findSingularAttribute, findSubTypesAttribute, getAttribute, getAttributes, getCollection, getCollection, getDeclaredAttribute, getDeclaredAttributes, getDeclaredCollection, getDeclaredCollection, getDeclaredList, getDeclaredList, getDeclaredMap, getDeclaredMap, getDeclaredPluralAttributes, getDeclaredSet, getDeclaredSet, getDeclaredSingularAttribute, getDeclaredSingularAttribute, getDeclaredSingularAttributes, getList, getList, getMap, getMap, getPluralAttributes, getRepresentationMode, getSet, getSet, getSingularAttribute, getSingularAttribute, getSingularAttributes, getSubTypes, getTypeName, isPrimitiveVariant, toString, visitAttributes, visitDeclaredAttributes, writeReplace
-
Methods inherited from class org.hibernate.metamodel.model.domain.AbstractDomainType
getBindableJavaType, getExpressibleJavaType, getJavaType
-
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
getSqmType, getTupleLength
-
Methods inherited from interface org.hibernate.metamodel.model.domain.ManagedDomainType
addSubType, findAttribute, findAttributeInSuperTypes, findConcreteGenericAttribute, findDeclaredAttribute, findDeclaredConcreteGenericAttribute, findDeclaredPluralAttribute, findDeclaredSingularAttribute, findPluralAttribute, findSingularAttribute, findSubTypesAttribute, getAttribute, getDeclaredAttribute, getRepresentationMode, getSubTypes, getTypeName, visitAttributes, visitDeclaredAttributes
-
Methods inherited from interface jakarta.persistence.metamodel.ManagedType
getAttributes, getCollection, getCollection, getDeclaredAttributes, getDeclaredCollection, getDeclaredCollection, getDeclaredList, getDeclaredList, getDeclaredMap, getDeclaredMap, getDeclaredPluralAttributes, getDeclaredSet, getDeclaredSet, getDeclaredSingularAttribute, getDeclaredSingularAttribute, getDeclaredSingularAttributes, getList, getList, getMap, getMap, getPluralAttributes, getSet, getSet, getSingularAttribute, getSingularAttribute, getSingularAttributes
-
Methods inherited from interface org.hibernate.query.sqm.SqmExpressible
getExpressibleJavaType, getRelationalJavaType, isInstance, resolveExpressible
-
Methods inherited from interface jakarta.persistence.metamodel.Type
getJavaType, getPersistenceType
-
-
-
-
Constructor Detail
-
AbstractIdentifiableType
public AbstractIdentifiableType(String typeName, JavaType<J> javaType, IdentifiableDomainType<? super J> superType, boolean hasIdClass, boolean hasIdentifierProperty, boolean versioned, JpaMetamodelImplementor metamodel)
-
-
Method Detail
-
createInFlightAccess
protected org.hibernate.metamodel.model.domain.AbstractIdentifiableType.InFlightAccessImpl createInFlightAccess()
- Overrides:
createInFlightAccess
in classAbstractManagedType<J>
-
getInFlightAccess
public org.hibernate.metamodel.model.domain.AbstractIdentifiableType.InFlightAccessImpl getInFlightAccess()
- Specified by:
getInFlightAccess
in interfaceAttributeContainer<J>
- Overrides:
getInFlightAccess
in classAbstractManagedType<J>
-
getIdentifierDescriptor
public SqmPathSource<?> getIdentifierDescriptor()
- Specified by:
getIdentifierDescriptor
in interfaceIdentifiableDomainType<J>
-
hasIdClass
public boolean hasIdClass()
- Specified by:
hasIdClass
in interfaceIdentifiableDomainType<J>
-
hasSingleIdAttribute
public boolean hasSingleIdAttribute()
- Specified by:
hasSingleIdAttribute
in interfaceIdentifiableType<J>
-
getSuperType
public IdentifiableDomainType<? super J> getSuperType()
Description copied from interface:ManagedDomainType
The descriptor of the supertype of this type.- Specified by:
getSuperType
in interfaceManagedDomainType<J>
- Overrides:
getSuperType
in classAbstractManagedType<J>
-
getSupertype
public IdentifiableDomainType<? super J> getSupertype()
- Specified by:
getSupertype
in interfaceIdentifiableDomainType<J>
- Specified by:
getSupertype
in interfaceIdentifiableType<J>
-
getId
public <Y> SingularPersistentAttribute<? super J,Y> getId(Class<Y> javaType)
- Specified by:
getId
in interfaceIdentifiableDomainType<J>
- Specified by:
getId
in interfaceIdentifiableType<J>
-
findIdAttribute
public SingularPersistentAttribute<? super J,?> findIdAttribute()
- Specified by:
findIdAttribute
in interfaceIdentifiableDomainType<J>
-
getDeclaredId
public <Y> SingularPersistentAttribute<J,Y> getDeclaredId(Class<Y> javaType)
- Specified by:
getDeclaredId
in interfaceIdentifiableDomainType<J>
- Specified by:
getDeclaredId
in interfaceIdentifiableType<J>
-
getIdType
public SimpleDomainType<?> getIdType()
- Specified by:
getIdType
in interfaceIdentifiableDomainType<J>
- Specified by:
getIdType
in interfaceIdentifiableType<J>
-
getIdClassAttributesSafely
public Set<SingularPersistentAttribute<? super J,?>> getIdClassAttributesSafely()
A form ofgetIdClassAttributes()
which prefers to returnnull
rather than throw exceptions- Returns:
- IdClass attributes or
null
-
getIdClassAttributes
public Set<SingularAttribute<? super J,?>> getIdClassAttributes()
- Specified by:
getIdClassAttributes
in interfaceIdentifiableDomainType<J>
- Specified by:
getIdClassAttributes
in interfaceIdentifiableType<J>
-
visitIdClassAttributes
public void visitIdClassAttributes(Consumer<SingularPersistentAttribute<? super J,?>> attributeConsumer)
- Specified by:
visitIdClassAttributes
in interfaceIdentifiableDomainType<J>
-
hasVersionAttribute
public boolean hasVersionAttribute()
- Specified by:
hasVersionAttribute
in interfaceIdentifiableType<J>
-
hasDeclaredVersionAttribute
public boolean hasDeclaredVersionAttribute()
-
getVersion
public <Y> SingularPersistentAttribute<? super J,Y> getVersion(Class<Y> javaType)
- Specified by:
getVersion
in interfaceIdentifiableDomainType<J>
- Specified by:
getVersion
in interfaceIdentifiableType<J>
-
findVersionAttribute
public SingularPersistentAttribute<? super J,?> findVersionAttribute()
- Specified by:
findVersionAttribute
in interfaceIdentifiableDomainType<J>
-
findNaturalIdAttributes
public List<? extends PersistentAttribute<? super J,?>> findNaturalIdAttributes()
- Specified by:
findNaturalIdAttributes
in interfaceIdentifiableDomainType<J>
-
getDeclaredVersion
public <Y> SingularPersistentAttribute<J,Y> getDeclaredVersion(Class<Y> javaType)
- Specified by:
getDeclaredVersion
in interfaceIdentifiableDomainType<J>
- Specified by:
getDeclaredVersion
in interfaceIdentifiableType<J>
-
getDeclaredVersion
public SingularAttribute<J,?> getDeclaredVersion()
For used to retrieve the declared version when populating the static metamodel.- Returns:
- The declared
-
isIdMappingRequired
protected boolean isIdMappingRequired()
-
-