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 of
IdentifiableType
.
An identifiable type is one which may have an identifier attribute, that is, an entity type or a mapped superclass.
- See Also:
- 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
ConstructorsConstructorDescriptionAbstractIdentifiableType
(String typeName, JavaType<J> javaType, IdentifiableDomainType<? super J> superType, boolean hasIdClass, boolean hasIdentifierProperty, boolean versioned, JpaMetamodelImplementor metamodel) -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributeContainer.InFlightAccess<J>
SingularPersistentAttribute<? super J,
?> List<? extends PersistentAttribute<? super J,
?>> SingularPersistentAttribute<? super J,
?> <Y> SingularPersistentAttribute<J,
Y> getDeclaredId
(Class<Y> javaType) For used to retrieve the declared version when populating the static metamodel.<Y> SingularPersistentAttribute<J,
Y> getDeclaredVersion
(Class<Y> javaType) <Y> SingularPersistentAttribute<? super J,
Y> Set<SingularAttribute<? super J,
?>> Set<SingularPersistentAttribute<? super J,
?>> A form ofgetIdClassAttributes()
which prefers to returnnull
rather than throw exceptionsIdentifiableDomainType<? super J>
IdentifiableDomainType<? super J>
The descriptor of the supertype of this type.<Y> SingularPersistentAttribute<? super J,
Y> getVersion
(Class<Y> javaType) boolean
boolean
boolean
boolean
protected boolean
void
visitIdClassAttributes
(Consumer<SingularPersistentAttribute<? super J, ?>> attributeConsumer) 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, getInFlightAccess, 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 Details
-
AbstractIdentifiableType
public AbstractIdentifiableType(String typeName, JavaType<J> javaType, IdentifiableDomainType<? super J> superType, boolean hasIdClass, boolean hasIdentifierProperty, boolean versioned, JpaMetamodelImplementor metamodel)
-
-
Method Details
-
createInFlightAccess
- Overrides:
createInFlightAccess
in classAbstractManagedType<J>
-
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
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
- Specified by:
getSupertype
in interfaceIdentifiableDomainType<J>
- Specified by:
getSupertype
in interfaceIdentifiableType<J>
-
getId
- Specified by:
getId
in interfaceIdentifiableDomainType<J>
- Specified by:
getId
in interfaceIdentifiableType<J>
-
findIdAttribute
- Specified by:
findIdAttribute
in interfaceIdentifiableDomainType<J>
-
getDeclaredId
- Specified by:
getDeclaredId
in interfaceIdentifiableDomainType<J>
- Specified by:
getDeclaredId
in interfaceIdentifiableType<J>
-
getIdType
- Specified by:
getIdType
in interfaceIdentifiableDomainType<J>
- Specified by:
getIdType
in interfaceIdentifiableType<J>
-
getIdClassAttributesSafely
A form ofgetIdClassAttributes()
which prefers to returnnull
rather than throw exceptions- Returns:
- IdClass attributes or
null
-
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
- Specified by:
getVersion
in interfaceIdentifiableDomainType<J>
- Specified by:
getVersion
in interfaceIdentifiableType<J>
-
findVersionAttribute
- Specified by:
findVersionAttribute
in interfaceIdentifiableDomainType<J>
-
findNaturalIdAttributes
- Specified by:
findNaturalIdAttributes
in interfaceIdentifiableDomainType<J>
-
getDeclaredVersion
- Specified by:
getDeclaredVersion
in interfaceIdentifiableDomainType<J>
- Specified by:
getDeclaredVersion
in interfaceIdentifiableType<J>
-
getDeclaredVersion
For used to retrieve the declared version when populating the static metamodel.- Returns:
- The declared
-
isIdMappingRequired
protected boolean isIdMappingRequired()
-