Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.metamodel

public abstract Class IdentifiableTypeImpl<X>

extends ManagedTypeImpl<X>
implements IdentifiableType<X>
Class Inheritance
All Implemented Interfaces
jakarta.persistence.metamodel.IdentifiableType, jakarta.persistence.metamodel.ManagedType, jakarta.persistence.metamodel.Type
Known Direct Subclasses
org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl, org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl
Type Parameters
<X>
The represented entity or mapped superclass type.
Imports
java.util.ArrayList, .HashSet, .List, .Set, jakarta.persistence.metamodel.Attribute, .Bindable, .IdentifiableType, .SingularAttribute, .Type, org.eclipse.persistence.descriptors.CMPPolicy, .ClassDescriptor, org.eclipse.persistence.internal.helper.DatabaseField, org.eclipse.persistence.internal.localization.ExceptionLocalization, org.eclipse.persistence.mappings.DatabaseMapping

Purpose: Provides the implementation for the Entity interface of the JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API)

Description: Instances of the type IdentifiableType represent entity or mapped superclass types.

Since
EclipseLink 1.2 - JPA 2.0
See Also
jakarta.persistence.metamodel.EntityType

Field Summary

Modifier and TypeField and Description
private Set<SingularAttribute<? super X, ?>>
idAttributes

The collection of SingularAttributes that are Id attributes.

private IdentifiableType<? super X>
superType

The supertype may be an entity or mappedSuperclass.

private SingularAttribute<? super X, ?>
versionAttribute

The SingularAttribute if it exists that is a version attribute

Inherited from org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeImpl:
descriptormetamodel

Constructor Summary

AccessConstructor and Description
protected

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
)

Implements jakarta.persistence.metamodel.IdentifiableType.getDeclaredId.

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
)

Implements jakarta.persistence.metamodel.IdentifiableType.getDeclaredVersion.

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
)

Implements jakarta.persistence.metamodel.IdentifiableType.getId.

Return the attribute that corresponds to the id attribute of the entity or mapped superclass.
public Set<SingularAttribute<? super X, ?>>

Returns:

id attributes
getIdClassAttributes
()

Implements jakarta.persistence.metamodel.IdentifiableType.getIdClassAttributes.

Return the attributes corresponding to the id class of the identifiable type.
public Type<?>

Returns:

type of id
getIdType
()

Implements jakarta.persistence.metamodel.IdentifiableType.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
()

Implements jakarta.persistence.metamodel.IdentifiableType.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
)

Implements jakarta.persistence.metamodel.IdentifiableType.getVersion.

Return the attribute that corresponds to the version attribute of the entity or mapped superclass.
private <Y> SingularAttribute<? super X, ?>
getVersion()

INTERNAL: Return the version attribute on this type.

public boolean

Returns:

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

Implements jakarta.persistence.metamodel.IdentifiableType.hasSingleIdAttribute.

Whether or not the identifiable type has an id attribute.
public boolean

Returns:

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

Implements jakarta.persistence.metamodel.IdentifiableType.hasVersionAttribute.

Whether or not the identifiable type has a version attribute.
protected void
initializeIdAttributes()

INTERNAL: The idAttributes collection is computed at the end of MetamodelImpl.initialize()

protected boolean
isIdentifiableType()

Overrides org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeImpl.isIdentifiableType.

INTERNAL: Return whether this type is identifiable.
protected void
setSupertype(IdentifiableType<? super X>
- the entity or mappedSuperclass superType
superType
)

INTERNAL: Set the superType for this IdentifiableType - only after all ManagedTypes have been instantiated for this Metamodel.

Inherited from org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeImpl:
creategetAttributegetAttributesgetCollectiongetCollectiongetDeclaredAttributegetDeclaredAttributegetDeclaredAttributesgetDeclaredCollectiongetDeclaredCollectiongetDeclaredListgetDeclaredListgetDeclaredMapgetDeclaredMapgetDeclaredPluralAttributesgetDeclaredSetgetDeclaredSetgetDeclaredSingularAttributegetDeclaredSingularAttributegetDeclaredSingularAttributesgetDescriptorgetListgetListgetMapgetMapgetMembersgetMetamodelgetPluralAttributesgetSetgetSetgetSingularAttributegetSingularAttributegetSingularAttributesgetTypeClassFromAttributeOrMethodLevelAccessorinitializeisManagedTypetoStringHelper

Field Detail

idAttributesback to summary
private Set<SingularAttribute<? super X, ?>> idAttributes

The collection of SingularAttributes that are Id attributes.

superTypeback to summary
private IdentifiableType<? super X> superType

The supertype may be an entity or mappedSuperclass.

For top-level inheritance root identifiable types with no superclass - return null (not Object)

versionAttributeback to summary
private SingularAttribute<? super X, ?> versionAttribute

The SingularAttribute if it exists that is a version attribute

Constructor Detail

IdentifiableTypeImplback to summary
protected IdentifiableTypeImpl(MetamodelImpl metamodel, ClassDescriptor descriptor)

Method Detail

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

Implements jakarta.persistence.metamodel.IdentifiableType.getDeclaredId.

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

Annotations
@Override
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)

Implements jakarta.persistence.metamodel.IdentifiableType.getDeclaredVersion.

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

Annotations
@Override
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)

Implements jakarta.persistence.metamodel.IdentifiableType.getId.

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

Annotations
@Override
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()

Implements jakarta.persistence.metamodel.IdentifiableType.getIdClassAttributes.

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

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

id attributes

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

Implements jakarta.persistence.metamodel.IdentifiableType.getIdType.

Return the type that represents the type of the id.

Returns:Type<?>

type of id

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

Implements jakarta.persistence.metamodel.IdentifiableType.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

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

Implements jakarta.persistence.metamodel.IdentifiableType.getVersion.

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

Annotations
@Override
Exceptions
IllegalArgumentException:
if version attribute of the given type is not present in the identifiable type
getVersionback to summary
private <Y> SingularAttribute<? super X, ?> getVersion()

INTERNAL: Return the version attribute on this type. If no version attribute exists - return null.

hasSingleIdAttributeback to summary
public boolean hasSingleIdAttribute()

Implements jakarta.persistence.metamodel.IdentifiableType.hasSingleIdAttribute.

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

Returns:boolean

boolean indicating whether or not the identifiable type has a single id attribute

Annotations
@Override
hasVersionAttributeback to summary
public boolean hasVersionAttribute()

Implements jakarta.persistence.metamodel.IdentifiableType.hasVersionAttribute.

Whether or not the identifiable type has a version attribute.

Returns:boolean

boolean indicating whether or not the identifiable type has a version attribute

Annotations
@Override
initializeIdAttributesback to summary
protected void initializeIdAttributes()

INTERNAL: The idAttributes collection is computed at the end of MetamodelImpl.initialize()

isIdentifiableTypeback to summary
protected boolean isIdentifiableType()

Overrides org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeImpl.isIdentifiableType.

INTERNAL: Return whether this type is identifiable. This would be EntityType and MappedSuperclassType

Annotations
@Override
setSupertypeback to summary
protected void setSupertype(IdentifiableType<? super X> superType)

INTERNAL: Set the superType for this IdentifiableType - only after all ManagedTypes have been instantiated for this Metamodel.

Top-level identifiable types have their supertype set to null.

Parameters
superType:IdentifiableType<? super X>

- the entity or mappedSuperclass superType