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.
- Author:
- Steve Ebersole
- See Also:
-
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 AbstractIdentifiableType<J>.org.hibernate.metamodel.model.domain.AbstractIdentifiableType.InFlightAccessImplSingularPersistentAttribute<? super J,?> List<? extends PersistentAttribute<? super J,?>> SingularPersistentAttribute<? super J,?> <Y> SingularPersistentAttribute<J,Y> getDeclaredId(Class<Y> javaType) Return the attribute that corresponds to the id attribute declared by the entity or mapped superclass.For used to retrieve the declared version when populating the static metamodel.<Y> SingularPersistentAttribute<J,Y> getDeclaredVersion(Class<Y> javaType) Return the attribute that corresponds to the version attribute declared by the entity or mapped superclass.<Y> SingularPersistentAttribute<? super J,Y> Return the attribute that corresponds to the id attribute of the entity or mapped superclass.Set<SingularAttribute<? super J,?>> Return the attributes corresponding to the id class of the identifiable type.Set<SingularPersistentAttribute<? super J,?>> A form ofgetIdClassAttributes()which prefers to returnnullrather than throw exceptionsReturn the type that represents the type of the id.AbstractIdentifiableType<J>.org.hibernate.metamodel.model.domain.AbstractIdentifiableType.InFlightAccessImplIdentifiableDomainType<? super J>Return the identifiable type that corresponds to the most specific mapped superclass or entity extended by the entity or mapped superclass.IdentifiableDomainType<? super J>The descriptor of the supertype of this type.<Y> SingularPersistentAttribute<? super J,Y> getVersion(Class<Y> javaType) Return the attribute that corresponds to the version attribute of the entity or mapped superclass.booleanbooleanbooleanWhether the identifiable type has a single id attribute.booleanWhether the identifiable type has a version attribute.protected booleanvoidvisitIdClassAttributes(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, getList, getList, getMap, getMap, getPluralAttributes, getRepresentationMode, getSet, getSet, getSingularAttribute, getSingularAttribute, getSingularAttributes, getSubTypes, getTypeName, isPrimitiveVariant, toString, visitAttributes, visitDeclaredAttributes, writeReplaceMethods 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.metamodel.model.domain.ManagedDomainType
addSubType, findAttribute, findAttributeInSuperTypes, findConcreteGenericAttribute, findDeclaredAttribute, findDeclaredConcreteGenericAttribute, findDeclaredPluralAttribute, findDeclaredSingularAttribute, findPluralAttribute, findSingularAttribute, findSubTypesAttribute, getAttribute, getDeclaredAttribute, getRepresentationMode, getSubTypes, getTypeName, visitAttributes, visitDeclaredAttributesMethods 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, getSingularAttributesMethods inherited from interface org.hibernate.query.sqm.SqmExpressible
getExpressibleJavaType, getRelationalJavaType, isInstance, resolveExpressibleMethods 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
protected AbstractIdentifiableType<J>.org.hibernate.metamodel.model.domain.AbstractIdentifiableType.InFlightAccessImpl createInFlightAccess()- Overrides:
createInFlightAccessin classAbstractManagedType<J>
-
getInFlightAccess
public AbstractIdentifiableType<J>.org.hibernate.metamodel.model.domain.AbstractIdentifiableType.InFlightAccessImpl getInFlightAccess()- Specified by:
getInFlightAccessin interfaceAttributeContainer<J>- Overrides:
getInFlightAccessin classAbstractManagedType<J>
-
getIdentifierDescriptor
- Specified by:
getIdentifierDescriptorin interfaceIdentifiableDomainType<J>
-
hasIdClass
public boolean hasIdClass()- Specified by:
hasIdClassin interfaceIdentifiableDomainType<J>
-
hasSingleIdAttribute
public boolean hasSingleIdAttribute()Description copied from interface:IdentifiableTypeWhether the identifiable type has a single id attribute. Returns true for a simple id or embedded id; returns false for an idclass.- Specified by:
hasSingleIdAttributein interfaceIdentifiableType<J>- Returns:
- boolean indicating whether the identifiable type has a single id attribute
-
getSuperType
Description copied from interface:ManagedDomainTypeThe descriptor of the supertype of this type.- Specified by:
getSuperTypein interfaceManagedDomainType<J>- Overrides:
getSuperTypein classAbstractManagedType<J>
-
getSupertype
Description copied from interface:IdentifiableTypeReturn the identifiable type that corresponds to the most specific mapped superclass or entity extended by the entity or mapped superclass.- Specified by:
getSupertypein interfaceIdentifiableDomainType<J>- Specified by:
getSupertypein interfaceIdentifiableType<J>- Returns:
- supertype of identifiable type or null if no such supertype
-
getId
Description copied from interface:IdentifiableTypeReturn the attribute that corresponds to the id attribute of the entity or mapped superclass.- Specified by:
getIdin interfaceIdentifiableDomainType<J>- Specified by:
getIdin interfaceIdentifiableType<J>- Parameters:
javaType- the type of the represented id attribute- Returns:
- id attribute
-
findIdAttribute
- Specified by:
findIdAttributein interfaceIdentifiableDomainType<J>
-
getDeclaredId
Description copied from interface:IdentifiableTypeReturn the attribute that corresponds to the id attribute declared by the entity or mapped superclass.- Specified by:
getDeclaredIdin interfaceIdentifiableDomainType<J>- Specified by:
getDeclaredIdin interfaceIdentifiableType<J>- Parameters:
javaType- the type of the represented declared id attribute- Returns:
- declared id attribute
-
getIdType
Description copied from interface:IdentifiableTypeReturn the type that represents the type of the id.- Specified by:
getIdTypein interfaceIdentifiableDomainType<J>- Specified by:
getIdTypein interfaceIdentifiableType<J>- Returns:
- type of id
-
getIdClassAttributesSafely
A form ofgetIdClassAttributes()which prefers to returnnullrather than throw exceptions- Returns:
- IdClass attributes or
null
-
getIdClassAttributes
Description copied from interface:IdentifiableTypeReturn the attributes corresponding to the id class of the identifiable type.- Specified by:
getIdClassAttributesin interfaceIdentifiableDomainType<J>- Specified by:
getIdClassAttributesin interfaceIdentifiableType<J>- Returns:
- id attributes
-
visitIdClassAttributes
public void visitIdClassAttributes(Consumer<SingularPersistentAttribute<? super J, ?>> attributeConsumer) - Specified by:
visitIdClassAttributesin interfaceIdentifiableDomainType<J>
-
hasVersionAttribute
public boolean hasVersionAttribute()Description copied from interface:IdentifiableTypeWhether the identifiable type has a version attribute.- Specified by:
hasVersionAttributein interfaceIdentifiableType<J>- Returns:
- boolean indicating whether the identifiable type has a version attribute
-
hasDeclaredVersionAttribute
public boolean hasDeclaredVersionAttribute() -
getVersion
Description copied from interface:IdentifiableTypeReturn the attribute that corresponds to the version attribute of the entity or mapped superclass.- Specified by:
getVersionin interfaceIdentifiableDomainType<J>- Specified by:
getVersionin interfaceIdentifiableType<J>- Parameters:
javaType- the type of the represented version attribute- Returns:
- version attribute
-
findVersionAttribute
- Specified by:
findVersionAttributein interfaceIdentifiableDomainType<J>
-
findNaturalIdAttributes
- Specified by:
findNaturalIdAttributesin interfaceIdentifiableDomainType<J>
-
getDeclaredVersion
Description copied from interface:IdentifiableTypeReturn the attribute that corresponds to the version attribute declared by the entity or mapped superclass.- Specified by:
getDeclaredVersionin interfaceIdentifiableDomainType<J>- Specified by:
getDeclaredVersionin interfaceIdentifiableType<J>- Parameters:
javaType- the type of the represented declared version attribute- Returns:
- declared version attribute
-
getDeclaredVersion
For used to retrieve the declared version when populating the static metamodel.- Returns:
- The declared
-
isIdMappingRequired
protected boolean isIdMappingRequired()
-