public abstract class AbstractIdentifiableType<X> extends AbstractManagedType<X> implements IdentifiableType<X>, Serializable
IdentifiableType types. JPA defines
identifiable types as entities or mapped-superclasses. Basically things to which an
identifier can be attached.
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.| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractIdentifiableType.Builder<X> |
Type.PersistenceType| Constructor and Description |
|---|
AbstractIdentifiableType(Class<X> javaType,
String typeName,
AbstractIdentifiableType<? super X> superType,
boolean hasIdClass,
boolean hasIdentifierProperty,
boolean versioned) |
| Modifier and Type | Method and Description |
|---|---|
AbstractIdentifiableType.Builder<X> |
getBuilder() |
<Y> SingularAttribute<X,Y> |
getDeclaredId(Class<Y> javaType)
Return the attribute that corresponds to the id attribute
declared by the entity or mapped superclass.
|
SingularAttribute<X,?> |
getDeclaredVersion()
For used to retrieve the declared version when populating the static metamodel.
|
<Y> SingularAttribute<X,Y> |
getDeclaredVersion(Class<Y> javaType)
Return the attribute that corresponds to the version
attribute declared by the entity or mapped superclass.
|
<Y> SingularAttribute<? super X,Y> |
getId(Class<Y> javaType)
Return the attribute that corresponds to the id attribute of
the entity or mapped superclass.
|
Set<SingularAttribute<? super X,?>> |
getIdClassAttributes()
Return the attributes corresponding to the id class of the
identifiable type.
|
Set<SingularAttribute<? super X,?>> |
getIdClassAttributesSafely()
A form of
getIdClassAttributes() which prefers to return null rather than throw exceptions |
Type<?> |
getIdType()
Return the type that represents the type of the id.
|
AbstractIdentifiableType<? super X> |
getSupertype()
Return the identifiable type that corresponds to the most
specific mapped superclass or entity extended by the entity
or mapped superclass.
|
<Y> SingularAttribute<? super X,Y> |
getVersion(Class<Y> javaType)
Return the attribute that corresponds to the version
attribute of the entity or mapped superclass.
|
boolean |
hasDeclaredVersionAttribute() |
boolean |
hasIdClass() |
boolean |
hasSingleIdAttribute()
Whether the identifiable type has a single id attribute.
|
boolean |
hasVersionAttribute()
Whether the identifiable type has a version attribute.
|
protected SingularAttributeImpl |
internalGetId() |
protected SingularAttributeImpl |
internalGetVersion() |
getAttribute, getAttributes, getCollection, getCollection, getDeclaredAttribute, getDeclaredAttributes, getDeclaredCollection, getDeclaredCollection, getDeclaredList, getDeclaredList, getDeclaredMap, getDeclaredMap, getDeclaredPluralAttributes, getDeclaredSet, getDeclaredSet, getDeclaredSingularAttribute, getDeclaredSingularAttribute, getDeclaredSingularAttributes, getList, getList, getMap, getMap, getPluralAttributes, getSet, getSet, getSingularAttribute, getSingularAttribute, getSingularAttributes, isPrimitiveVariant, lockgetJavaType, getTypeNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttribute, getAttributes, getCollection, getCollection, getDeclaredAttribute, getDeclaredAttributes, getDeclaredCollection, getDeclaredCollection, getDeclaredList, getDeclaredList, getDeclaredMap, getDeclaredMap, getDeclaredPluralAttributes, getDeclaredSet, getDeclaredSet, getDeclaredSingularAttribute, getDeclaredSingularAttribute, getDeclaredSingularAttributes, getList, getList, getMap, getMap, getPluralAttributes, getSet, getSet, getSingularAttribute, getSingularAttribute, getSingularAttributesgetJavaType, getPersistenceTypepublic AbstractIdentifiableType(Class<X> javaType, String typeName, AbstractIdentifiableType<? super X> superType, boolean hasIdClass, boolean hasIdentifierProperty, boolean versioned)
public boolean hasIdClass()
public boolean hasSingleIdAttribute()
IdentifiableTypehasSingleIdAttribute in interface IdentifiableType<X>public AbstractIdentifiableType<? super X> getSupertype()
IdentifiableTypegetSupertype in interface IdentifiableType<X>getSupertype in class AbstractManagedType<X>public <Y> SingularAttribute<? super X,Y> getId(Class<Y> javaType)
IdentifiableTypegetId in interface IdentifiableType<X>javaType - the type of the represented id attributeprotected SingularAttributeImpl internalGetId()
public <Y> SingularAttribute<X,Y> getDeclaredId(Class<Y> javaType)
IdentifiableTypegetDeclaredId in interface IdentifiableType<X>javaType - the type of the represented declared
id attributepublic Type<?> getIdType()
IdentifiableTypegetIdType in interface IdentifiableType<X>public Set<SingularAttribute<? super X,?>> getIdClassAttributesSafely()
getIdClassAttributes() which prefers to return null rather than throw exceptionsnullpublic Set<SingularAttribute<? super X,?>> getIdClassAttributes()
IdentifiableTypegetIdClassAttributes in interface IdentifiableType<X>public boolean hasVersionAttribute()
IdentifiableTypehasVersionAttribute in interface IdentifiableType<X>public boolean hasDeclaredVersionAttribute()
public <Y> SingularAttribute<? super X,Y> getVersion(Class<Y> javaType)
IdentifiableTypegetVersion in interface IdentifiableType<X>javaType - the type of the represented version attributeprotected SingularAttributeImpl internalGetVersion()
public <Y> SingularAttribute<X,Y> getDeclaredVersion(Class<Y> javaType)
IdentifiableTypegetDeclaredVersion in interface IdentifiableType<X>javaType - the type of the represented declared version
attributepublic SingularAttribute<X,?> getDeclaredVersion()
public AbstractIdentifiableType.Builder<X> getBuilder()
getBuilder in class AbstractManagedType<X>Copyright © 2018 JBoss by Red Hat. All rights reserved.