Module org.eclipse.persistence.jpa
Class MetamodelImpl
java.lang.Object
org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl
- All Implemented Interfaces:
Metamodel
,Serializable
Purpose: Provides the implementation for the Metamodel interface of the JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API)
Description: Provides access to the metamodel of persistent Entities, MappedSuperclasses, Embeddables, ManagedTypes and Types in the persistence unit. Note: Since the types Map is lazy-loaded with key:value pairs - the designer and especially the user must realized that a particular BasicType may not be in the Map until it is referenced.
- Since:
- EclipseLink 1.2 - JPA 2.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionDefault elementType Class when we the type cannot be determined for unsupported mappings such as Transformation and VariableOneToOne -
Constructor Summary
ConstructorDescriptionMetamodelImpl
(EntityManagerSetupImpl emSetupImpl) INTERNAL:MetamodelImpl
(AbstractSession session) -
Method Summary
Modifier and TypeMethodDescription<X> EmbeddableType
<X> embeddable
(Class<X> clazz) Return the metamodel embeddable type representing the embeddable class.<X> EntityType
<X> Return the metamodel entity type representing the entity.INTERNAL: Return a List of all attributes for all ManagedTypes.Set
<EmbeddableType<?>> Return the metamodel embeddable types.Set
<EntityType<?>> Return the metamodel entity types.Set
<ManagedType<?>> Return the metamodel managed types.Map
<String, ManagedTypeImpl<?>> Return the metamodel managed types map.INTERNAL: Return the Set of MappedSuperclassType objectsINTERNAL: Return the core API Project associated with the DatabaseSession that is associated with this Metamodelprotected AbstractSession
INTERNAL: Return the DatabaseSession associated with this Metamodel<X> TypeImpl
<X> INTERNAL: Return a Type representation of a java Class for use by the Metamodel Attributes.getTypes()
INTERNAL: Return the Map of types on this metamodel.protected boolean
hasMappedSuperclass
(String qualifiedClassNameKeyString) INTERNAL: Return whether there is a descriptor that is keyed by the supplied class name.void
initialize
(ClassLoader classLoader) INTERNAL: Initialize the JPA metamodel that wraps the EclipseLink JPA metadata created descriptors.
Note: Since the types Map is lazy-loaded with key:value pairs - the designer and especially the user must realized that a particular BasicType may not be in the Map until it is referenced.boolean
<X> ManagedType
<X> managedType
(Class<X> clazz) Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.void
INTERNAL: Print out all the Type attributes in the MetamodeltoString()
INTERNAL: Return the string representation of the receiver.
-
Field Details
-
DEFAULT_ELEMENT_TYPE_FOR_UNSUPPORTED_MAPPINGS
Default elementType Class when we the type cannot be determined for unsupported mappings such as Transformation and VariableOneToOne
-
-
Constructor Details
-
MetamodelImpl
-
MetamodelImpl
-
MetamodelImpl
-
MetamodelImpl
INTERNAL:
-
-
Method Details
-
embeddable
Return the metamodel embeddable type representing the embeddable class.- Specified by:
embeddable
in interfaceMetamodel
- Parameters:
clazz
- the type of the represented embeddable class- Returns:
- the metamodel embeddable type
- Throws:
IllegalArgumentException
- if not an embeddable class
-
entity
Return the metamodel entity type representing the entity.- Specified by:
entity
in interfaceMetamodel
- Parameters:
clazz
- the type of the represented entity- Returns:
- the metamodel entity type
- Throws:
IllegalArgumentException
- if not an entity
-
getAllManagedTypeAttributes
INTERNAL: Return a List of all attributes for all ManagedTypes. -
getEmbeddables
Return the metamodel embeddable types.- Specified by:
getEmbeddables
in interfaceMetamodel
- Returns:
- the metamodel embeddable types
-
getEntities
Return the metamodel entity types.- Specified by:
getEntities
in interfaceMetamodel
- Returns:
- the metamodel entity types
-
getManagedTypesMap
Return the metamodel managed types map. -
getManagedTypes
Return the metamodel managed types.- Specified by:
getManagedTypes
in interfaceMetamodel
- Returns:
- the metamodel managed types
-
getMappedSuperclasses
INTERNAL: Return the Set of MappedSuperclassType objects -
getProject
INTERNAL: Return the core API Project associated with the DatabaseSession that is associated with this Metamodel -
getSession
INTERNAL: Return the DatabaseSession associated with this Metamodel -
getType
INTERNAL: Return a Type representation of a java Class for use by the Metamodel Attributes.If a type does not yet exist - one will be created and added to the Metamodel - this usually only for Basic types.
This function will handle all Metamodel defined and core java classes.
-
getTypes
INTERNAL: Return the Map of types on this metamodel. This includes all Entity, MappedSuperclass, Embeddable and Basic types -
hasMappedSuperclass
INTERNAL: Return whether there is a descriptor that is keyed by the supplied class name.Referenced by ManagedTypeImpl.create()
-
isInitialized
public boolean isInitialized() -
initialize
INTERNAL: Initialize the JPA metamodel that wraps the EclipseLink JPA metadata created descriptors.
Note: Since the types Map is lazy-loaded with key:value pairs - the designer and especially the user must realized that a particular BasicType may not be in the Map until it is referenced. Also note that a transient superclass (non-entity, non-mappedSuperclass) exists as a BasicType (it has no attributes), and that any inheriting Entity either directly subclassing or indirectly subclassing via a MappedSuperclass inheritance chain - does not pick up non-persistence fields that normally would be inherited. (The fields exist in Java but not in ORM:Metamodel) The transient class will have no JPA annotations. This is the second phase of metamodel initialization. It causes preindexed classes to have their attributes populated. -
managedType
Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.- Specified by:
managedType
in interfaceMetamodel
- Parameters:
clazz
- the type of the represented managed class- Returns:
- the metamodel managed type
- Throws:
IllegalArgumentException
- if not a managed class
-
printAllTypes
public void printAllTypes()INTERNAL: Print out all the Type attributes in the Metamodel -
toString
INTERNAL: Return the string representation of the receiver.
-