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>,org.hibernate.metamodel.model.domain.internal.AttributeContainer<J>,ManagedDomainType<J>,SimpleDomainType<J>,BindableType<J>,SqmExpressible<J>
public abstract class AbstractIdentifiableType<J> extends AbstractManagedType<J> implements IdentifiableDomainType<J>, Serializable
Defines commonality for the JPAIdentifiableTypetypes. JPA defines identifiable types as entities or mapped-superclasses. Basically things to which an identifier can be attached.- 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
org.hibernate.metamodel.model.domain.internal.AttributeContainer.InFlightAccess<J extends Object>
-
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 jpaMetamodel)
-
Method Summary
-
Methods inherited from class org.hibernate.metamodel.model.domain.AbstractManagedType
addSubType, findAttribute, findAttributeInSuperTypes, findConcreteGenericAttribute, findDeclaredAttribute, findDeclaredConcreteGenericAttribute, findDeclaredPluralAttribute, findDeclaredSingularAttribute, findPluralAttribute, findSingularAttribute, findSubType, findSubType, 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, makeSubGraph, toString, visitAttributes, visitDeclaredAttributes, writeReplace
-
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
addSubType, findAttribute, findAttributeInSuperTypes, findConcreteGenericAttribute, findDeclaredAttribute, findDeclaredConcreteGenericAttribute, findDeclaredPluralAttribute, findDeclaredSingularAttribute, findPluralAttribute, findSingularAttribute, findSubType, findSubType, findSubTypesAttribute, getAttribute, getDeclaredAttribute, getRepresentationMode, getSubTypes, getTypeName, makeSubGraph, makeSubGraph, 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
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 jpaMetamodel)
-
-
Method Detail
-
createInFlightAccess
protected org.hibernate.metamodel.model.domain.AbstractIdentifiableType.InFlightAccessImpl createInFlightAccess()
- Overrides:
createInFlightAccessin classAbstractManagedType<J>
-
getInFlightAccess
public org.hibernate.metamodel.model.domain.AbstractIdentifiableType.InFlightAccessImpl getInFlightAccess()
- Specified by:
getInFlightAccessin interfaceorg.hibernate.metamodel.model.domain.internal.AttributeContainer<J>- Overrides:
getInFlightAccessin classAbstractManagedType<J>
-
getIdentifierDescriptor
public SqmPathSource<?> getIdentifierDescriptor()
- Specified by:
getIdentifierDescriptorin interfaceIdentifiableDomainType<J>
-
hasIdClass
public boolean hasIdClass()
- Specified by:
hasIdClassin interfaceIdentifiableDomainType<J>
-
hasSingleIdAttribute
public boolean hasSingleIdAttribute()
- Specified by:
hasSingleIdAttributein interfaceIdentifiableType<J>
-
getSuperType
public IdentifiableDomainType<? super J> getSuperType()
Description copied from interface:ManagedDomainTypeThis type's super type descriptor. Note : we define this on the managed type descriptor in anticipation of supporting embeddable inheritance- Specified by:
getSuperTypein interfaceManagedDomainType<J>- Overrides:
getSuperTypein classAbstractManagedType<J>
-
getSupertype
public IdentifiableDomainType<? super J> getSupertype()
- Specified by:
getSupertypein interfaceIdentifiableDomainType<J>- Specified by:
getSupertypein interfaceIdentifiableType<J>
-
getId
public <Y> SingularPersistentAttribute<? super J,Y> getId(Class<Y> javaType)
- Specified by:
getIdin interfaceIdentifiableDomainType<J>- Specified by:
getIdin interfaceIdentifiableType<J>
-
findIdAttribute
public SingularPersistentAttribute<J,?> findIdAttribute()
- Specified by:
findIdAttributein interfaceIdentifiableDomainType<J>
-
getDeclaredId
public <Y> SingularPersistentAttribute<J,Y> getDeclaredId(Class<Y> javaType)
- Specified by:
getDeclaredIdin interfaceIdentifiableDomainType<J>- Specified by:
getDeclaredIdin interfaceIdentifiableType<J>
-
getIdType
public SimpleDomainType<?> getIdType()
- Specified by:
getIdTypein interfaceIdentifiableDomainType<J>- Specified by:
getIdTypein interfaceIdentifiableType<J>
-
getIdClassAttributesSafely
public Set<SingularPersistentAttribute<? super J,?>> getIdClassAttributesSafely()
A form ofgetIdClassAttributes()which prefers to returnnullrather than throw exceptions- Returns:
- IdClass attributes or
null
-
getIdClassAttributes
public Set<SingularAttribute<? super J,?>> getIdClassAttributes()
- Specified by:
getIdClassAttributesin interfaceIdentifiableDomainType<J>- Specified by:
getIdClassAttributesin interfaceIdentifiableType<J>
-
visitIdClassAttributes
public void visitIdClassAttributes(Consumer<SingularPersistentAttribute<? super J,?>> attributeConsumer)
- Specified by:
visitIdClassAttributesin interfaceIdentifiableDomainType<J>
-
hasVersionAttribute
public boolean hasVersionAttribute()
- Specified by:
hasVersionAttributein interfaceIdentifiableType<J>
-
hasDeclaredVersionAttribute
public boolean hasDeclaredVersionAttribute()
-
getVersion
public <Y> SingularPersistentAttribute<? super J,Y> getVersion(Class<Y> javaType)
- Specified by:
getVersionin interfaceIdentifiableDomainType<J>- Specified by:
getVersionin interfaceIdentifiableType<J>
-
findVersionAttribute
public SingularPersistentAttribute<? super J,?> findVersionAttribute()
- Specified by:
findVersionAttributein interfaceIdentifiableDomainType<J>
-
findNaturalIdAttributes
public List<? extends PersistentAttribute<? super J,?>> findNaturalIdAttributes()
- Specified by:
findNaturalIdAttributesin interfaceIdentifiableDomainType<J>
-
getDeclaredVersion
public <Y> SingularPersistentAttribute<J,Y> getDeclaredVersion(Class<Y> javaType)
- Specified by:
getDeclaredVersionin interfaceIdentifiableDomainType<J>- Specified by:
getDeclaredVersionin 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()
-
-