Top Description Methods
javax.persistence.metamodel

public Interface IdentifiableType<X>

extends ManagedType<X>
Known Direct Subinterfaces
javax.persistence.metamodel.MappedSuperclassType, javax.persistence.metamodel.EntityType
Type Parameters
<X>
The represented entity or mapped superclass type.
Imports
java.util.Set

Instances of the type IdentifiableType represent entity or mapped superclass types.
Since
Java Persistence 2.0

Method Summary

Modifier and TypeMethod and Description
public <Y> SingularAttribute<X, Y>

Returns:

declared id attribute
getDeclaredId
(Class<Y>
the type of the represented declared id attribute
type
)

Return the attribute that corresponds to the id attribute declared by the entity or mapped superclass.

public <Y> SingularAttribute<X, Y>

Returns:

declared version attribute
getDeclaredVersion
(Class<Y>
the type of the represented declared version attribute
type
)

Return the attribute that corresponds to the version attribute declared by the entity or mapped superclass.

public <Y> SingularAttribute<? super X, Y>

Returns:

id attribute
getId
(Class<Y>
the type of the represented id attribute
type
)

Return the attribute that corresponds to the id attribute of the entity or mapped superclass.

public Set<SingularAttribute<? super X, ?>>

Returns:

id attributes
getIdClassAttributes
()

Return the attributes corresponding to the id class of the identifiable type.

public Type<?>

Returns:

type of id
getIdType
()

Return the type that represents the type of the id.

public IdentifiableType<? super X>

Returns:

supertype of identifiable type or null if no such supertype
getSupertype
()

Return the identifiable type that corresponds to the most specific mapped superclass or entity extended by the entity or mapped superclass.

public <Y> SingularAttribute<? super X, Y>

Returns:

version attribute
getVersion
(Class<Y>
the type of the represented version attribute
type
)

Return the attribute that corresponds to the version attribute of the entity or mapped superclass.

public boolean

Returns:

boolean indicating whether the identifiable type has a single id attribute
hasSingleIdAttribute
()

Whether the identifiable type has a single id attribute.

public boolean

Returns:

boolean indicating whether the identifiable type has a version attribute
hasVersionAttribute
()

Whether the identifiable type has a version attribute.

Inherited from javax.persistence.metamodel.ManagedType:
getAttributegetAttributesgetCollectiongetCollectiongetDeclaredAttributegetDeclaredAttributesgetDeclaredCollectiongetDeclaredCollectiongetDeclaredListgetDeclaredListgetDeclaredMapgetDeclaredMapgetDeclaredPluralAttributesgetDeclaredSetgetDeclaredSetgetDeclaredSingularAttributegetDeclaredSingularAttributegetDeclaredSingularAttributesgetListgetListgetMapgetMapgetPluralAttributesgetSetgetSetgetSingularAttributegetSingularAttributegetSingularAttributes

Method Detail

getDeclaredIdback to summary
public <Y> SingularAttribute<X, Y> getDeclaredId(Class<Y> type)

Return the attribute that corresponds to the id attribute declared by the entity or mapped superclass.

Parameters
type:Class<Y>

the type of the represented declared id attribute

Returns:SingularAttribute<X, Y>

declared id attribute

Exceptions
IllegalArgumentException:
if id attribute of the given type is not declared in the identifiable type or if the identifiable type has an id class
getDeclaredVersionback to summary
public <Y> SingularAttribute<X, Y> getDeclaredVersion(Class<Y> type)

Return the attribute that corresponds to the version attribute declared by the entity or mapped superclass.

Parameters
type:Class<Y>

the type of the represented declared version attribute

Returns:SingularAttribute<X, Y>

declared version attribute

Exceptions
IllegalArgumentException:
if version attribute of the type is not declared in the identifiable type
getIdback to summary
public <Y> SingularAttribute<? super X, Y> getId(Class<Y> type)

Return the attribute that corresponds to the id attribute of the entity or mapped superclass.

Parameters
type:Class<Y>

the type of the represented id attribute

Returns:SingularAttribute<? super X, Y>

id attribute

Exceptions
IllegalArgumentException:
if id attribute of the given type is not present in the identifiable type or if the identifiable type has an id class
getIdClassAttributesback to summary
public Set<SingularAttribute<? super X, ?>> getIdClassAttributes()

Return the attributes corresponding to the id class of the identifiable type.

Returns:Set<SingularAttribute<? super X, ?>>

id attributes

Exceptions
IllegalArgumentException:
if the identifiable type does not have an id class
getIdTypeback to summary
public Type<?> getIdType()

Return the type that represents the type of the id.

Returns:Type<?>

type of id

getSupertypeback to summary
public IdentifiableType<? super X> getSupertype()

Return the identifiable type that corresponds to the most specific mapped superclass or entity extended by the entity or mapped superclass.

Returns:IdentifiableType<? super X>

supertype of identifiable type or null if no such supertype

getVersionback to summary
public <Y> SingularAttribute<? super X, Y> getVersion(Class<Y> type)

Return the attribute that corresponds to the version attribute of the entity or mapped superclass.

Parameters
type:Class<Y>

the type of the represented version attribute

Returns:SingularAttribute<? super X, Y>

version attribute

Exceptions
IllegalArgumentException:
if version attribute of the given type is not present in the identifiable type
hasSingleIdAttributeback to summary
public boolean hasSingleIdAttribute()

Whether the identifiable type has a single id attribute. Returns true for a simple id or embedded id; returns false for an idclass.

Returns:boolean

boolean indicating whether the identifiable type has a single id attribute

hasVersionAttributeback to summary
public boolean hasVersionAttribute()

Whether the identifiable type has a version attribute.

Returns:boolean

boolean indicating whether the identifiable type has a version attribute