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 hasIdentifierProperty,
boolean versioned) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkDeclaredId()
Centralized check to ensure the id is actually declared on the class mapped here, as opposed to a
super class.
|
protected void |
checkDeclaredVersion()
Centralized check to ensure the version (if one) is actually declared on the class mapped here, as opposed to a
super class.
|
protected void |
checkSimpleId()
Centralized check to ensure the id for this hierarchy is a simple one (i.e., does not use
an id-class).
|
AbstractIdentifiableType.Builder<X> |
getBuilder() |
<Y> SingularAttribute<X,Y> |
getDeclaredId(Class<Y> javaType) |
SingularAttribute<X,?> |
getDeclaredVersion()
For used to retrieve the declared version when populating the static metamodel.
|
<Y> SingularAttribute<X,Y> |
getDeclaredVersion(Class<Y> javaType) |
<Y> SingularAttribute<? super X,Y> |
getId(Class<Y> javaType) |
Set<SingularAttribute<? super X,?>> |
getIdClassAttributes() |
Type<?> |
getIdType() |
AbstractIdentifiableType<? super X> |
getSupertype() |
<Y> SingularAttribute<? super X,Y> |
getVersion(Class<Y> javaType) |
boolean |
hasDeclaredVersionAttribute() |
boolean |
hasSingleIdAttribute() |
boolean |
hasVersionAttribute() |
protected abstract boolean |
requiresSupertypeForNonDeclaredIdentifier()
Indicates if a non-null super type is required to provide the
identifier attribute(s) if this object does not have a declared
identifier.
|
protected AbstractIdentifiableType<? super X> |
requireSupertype() |
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, lock
getJavaType, getTypeName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
getJavaType, getPersistenceType
public AbstractIdentifiableType(Class<X> javaType, String typeName, AbstractIdentifiableType<? super X> superType, boolean hasIdentifierProperty, boolean versioned)
public AbstractIdentifiableType<? super X> getSupertype()
getSupertype
in interface IdentifiableType<X>
getSupertype
in class AbstractManagedType<X>
protected abstract boolean requiresSupertypeForNonDeclaredIdentifier()
protected AbstractIdentifiableType<? super X> requireSupertype()
public boolean hasSingleIdAttribute()
hasSingleIdAttribute
in interface IdentifiableType<X>
public <Y> SingularAttribute<? super X,Y> getId(Class<Y> javaType)
getId
in interface IdentifiableType<X>
protected void checkSimpleId()
checkIdClass()
public <Y> SingularAttribute<X,Y> getDeclaredId(Class<Y> javaType)
getDeclaredId
in interface IdentifiableType<X>
protected void checkDeclaredId()
public Type<?> getIdType()
getIdType
in interface IdentifiableType<X>
public Set<SingularAttribute<? super X,?>> getIdClassAttributes()
getIdClassAttributes
in interface IdentifiableType<X>
public boolean hasVersionAttribute()
hasVersionAttribute
in interface IdentifiableType<X>
public boolean hasDeclaredVersionAttribute()
public <Y> SingularAttribute<? super X,Y> getVersion(Class<Y> javaType)
getVersion
in interface IdentifiableType<X>
public <Y> SingularAttribute<X,Y> getDeclaredVersion(Class<Y> javaType)
getDeclaredVersion
in interface IdentifiableType<X>
public SingularAttribute<X,?> getDeclaredVersion()
protected void checkDeclaredVersion()
public AbstractIdentifiableType.Builder<X> getBuilder()
getBuilder
in class AbstractManagedType<X>
Copyright © 2001-2013 Red Hat, Inc. All Rights Reserved.