Module org.eclipse.persistence.jpa
Class IdentifiableTypeImpl<X>
java.lang.Object
org.eclipse.persistence.internal.jpa.metamodel.TypeImpl<X>
org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeImpl<X>
org.eclipse.persistence.internal.jpa.metamodel.IdentifiableTypeImpl<X>
- Type Parameters:
X- The represented entity or mapped superclass type.
- All Implemented Interfaces:
IdentifiableType<X>,ManagedType<X>,Type<X>,Serializable
- Direct Known Subclasses:
EntityTypeImpl,MappedSuperclassTypeImpl
public abstract class IdentifiableTypeImpl<X>
extends ManagedTypeImpl<X>
implements IdentifiableType<X>
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.persistence.metamodel.Type
Type.PersistenceType -
Field Summary
Fields inherited from class org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeImpl
descriptor, metamodel -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedIdentifiableTypeImpl(MetamodelImpl metamodel, ClassDescriptor descriptor) -
Method Summary
Modifier and TypeMethodDescription<Y> SingularAttribute<X, Y> getDeclaredId(Class<Y> type) Return the attribute that corresponds to the id attribute declared by the entity or mapped superclass.<Y> SingularAttribute<X, Y> getDeclaredVersion(Class<Y> type) Return the attribute that corresponds to the version attribute declared by the entity or mapped superclass.<Y> SingularAttribute<? super X, Y> Return the attribute that corresponds to the id attribute of the entity or mapped superclass.Set<SingularAttribute<? super X, ?>> Return the attributes corresponding to the id class of the identifiable type.Type<?> Return the type that represents the type of the id.IdentifiableType<? super X> 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> type) Return the attribute that corresponds to the version attribute of the entity or mapped superclass.booleanWhether or not the identifiable type has an id attribute.booleanWhether or not the identifiable type has a version attribute.protected voidINTERNAL: The idAttributes collection is computed at the end of MetamodelImpl.initialize()protected booleanINTERNAL: Return whether this type is identifiable.protected voidsetSupertype(IdentifiableType<? super X> superType) INTERNAL: Set the superType for this IdentifiableType - only after all ManagedTypes have been instantiated for this Metamodel.Methods inherited from class org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeImpl
create, getAttribute, getAttributes, getCollection, getCollection, getDeclaredAttribute, getDeclaredAttribute, getDeclaredAttributes, getDeclaredCollection, getDeclaredCollection, getDeclaredList, getDeclaredList, getDeclaredMap, getDeclaredMap, getDeclaredPluralAttributes, getDeclaredSet, getDeclaredSet, getDeclaredSingularAttribute, getDeclaredSingularAttribute, getDeclaredSingularAttributes, getDescriptor, getList, getList, getMap, getMap, getMembers, getMetamodel, getPluralAttributes, getSet, getSet, getSingularAttribute, getSingularAttribute, getSingularAttributes, getTypeClassFromAttributeOrMethodLevelAccessor, initialize, isManagedType, toStringHelperMethods inherited from class org.eclipse.persistence.internal.jpa.metamodel.TypeImpl
getJavaType, getJavaType, getJavaTypeName, isEntity, isMappedSuperclass, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface jakarta.persistence.metamodel.ManagedType
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, getSingularAttributesMethods inherited from interface jakarta.persistence.metamodel.Type
getJavaType, getPersistenceType
-
Constructor Details
-
IdentifiableTypeImpl
-
-
Method Details
-
initializeIdAttributes
protected void initializeIdAttributes()INTERNAL: The idAttributes collection is computed at the end of MetamodelImpl.initialize() -
getDeclaredId
Return the attribute that corresponds to the id attribute declared by the entity or mapped superclass.- Specified by:
getDeclaredIdin interfaceIdentifiableType<X>- Parameters:
type- the type of the represented declared id attribute- Returns:
- declared id attribute
- Throws:
IllegalArgumentException- if id attribute of the given type is not declared in the identifiable type or if the identifiable type has an id class
-
getDeclaredVersion
Return the attribute that corresponds to the version attribute declared by the entity or mapped superclass.- Specified by:
getDeclaredVersionin interfaceIdentifiableType<X>- Parameters:
type- the type of the represented declared version attribute- Returns:
- declared version attribute
- Throws:
IllegalArgumentException- if version attribute of the type is not declared in the identifiable type
-
getIdClassAttributes
Return the attributes corresponding to the id class of the identifiable type.- Specified by:
getIdClassAttributesin interfaceIdentifiableType<X>- Returns:
- id attributes
- Throws:
IllegalArgumentException- if the identifiable type does not have an id class
-
getId
Return the attribute that corresponds to the id attribute of the entity or mapped superclass.- Specified by:
getIdin interfaceIdentifiableType<X>- Parameters:
type- the type of the represented id attribute- Returns:
- id attribute
- Throws:
IllegalArgumentException- if id attribute of the given type is not present in the identifiable type or if the identifiable type has an id class
-
getIdType
Return the type that represents the type of the id.- Specified by:
getIdTypein interfaceIdentifiableType<X>- Returns:
- type of id
-
getSupertype
Return the identifiable type that corresponds to the most specific mapped superclass or entity extended by the entity or mapped superclass.- Specified by:
getSupertypein interfaceIdentifiableType<X>- Returns:
- supertype of identifiable type or null if no such supertype
-
getVersion
Return the attribute that corresponds to the version attribute of the entity or mapped superclass.- Specified by:
getVersionin interfaceIdentifiableType<X>- Parameters:
type- the type of the represented version attribute- Returns:
- version attribute
- Throws:
IllegalArgumentException- if version attribute of the given type is not present in the identifiable type
-
hasSingleIdAttribute
public boolean 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.- Specified by:
hasSingleIdAttributein interfaceIdentifiableType<X>- Returns:
- boolean indicating whether or not the identifiable type has a single id attribute
-
hasVersionAttribute
public boolean hasVersionAttribute()Whether or not the identifiable type has a version attribute.- Specified by:
hasVersionAttributein interfaceIdentifiableType<X>- Returns:
- boolean indicating whether or not the identifiable type has a version attribute
-
isIdentifiableType
protected boolean isIdentifiableType()INTERNAL: Return whether this type is identifiable. This would be EntityType and MappedSuperclassType- Overrides:
isIdentifiableTypein classManagedTypeImpl<X>
-
setSupertype
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- - the entity or mappedSuperclass superType
-