public class MetamodelImpl extends Object implements javax.persistence.metamodel.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.
Metamodel
,
Serialized FormModifier and Type | Field and Description |
---|---|
static Class |
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 and Description |
---|
MetamodelImpl(AbstractSession session) |
MetamodelImpl(javax.persistence.EntityManager em) |
MetamodelImpl(javax.persistence.EntityManagerFactory emf) |
MetamodelImpl(EntityManagerSetupImpl emSetupImpl)
INTERNAL:
|
Modifier and Type | Method and Description |
---|---|
<X> javax.persistence.metamodel.EmbeddableType<X> |
embeddable(Class<X> clazz)
Return the metamodel embeddable type representing the
embeddable class.
|
<X> javax.persistence.metamodel.EntityType<X> |
entity(Class<X> clazz)
Return the metamodel entity type representing the entity.
|
List<javax.persistence.metamodel.Attribute> |
getAllManagedTypeAttributes()
INTERNAL:
Return a List of all attributes for all ManagedTypes.
|
Set<javax.persistence.metamodel.EmbeddableType<?>> |
getEmbeddables()
Return the metamodel embeddable types.
|
Set<javax.persistence.metamodel.EntityType<?>> |
getEntities()
Return the metamodel entity types.
|
Set<javax.persistence.metamodel.ManagedType<?>> |
getManagedTypes()
Return the metamodel managed types.
|
Map<Class,ManagedTypeImpl<?>> |
getManagedTypesMap()
Return the metamodel managed types map.
|
Set<MappedSuperclassTypeImpl<?>> |
getMappedSuperclasses()
INTERNAL:
Return the Set of MappedSuperclassType objects
|
Project |
getProject()
INTERNAL:
Return the core API Project associated with the DatabaseSession
that is associated with this Metamodel
|
<X> TypeImpl<X> |
getType(Class<X> javaClass)
INTERNAL:
Return a Type representation of a java Class for use by the Metamodel Attributes.
|
Map<Class,TypeImpl<?>> |
getTypes()
INTERNAL:
Return the Map of types on this metamodel.
|
<X> javax.persistence.metamodel.ManagedType<X> |
managedType(Class<X> clazz)
Return the metamodel managed type representing the
entity, mapped superclass, or embeddable class.
|
void |
printAllTypes()
INTERNAL:
Print out all the Type attributes in the Metamodel
|
String |
toString()
INTERNAL:
Return the string representation of the receiver.
|
public static final Class DEFAULT_ELEMENT_TYPE_FOR_UNSUPPORTED_MAPPINGS
public MetamodelImpl(AbstractSession session)
public MetamodelImpl(javax.persistence.EntityManager em)
public MetamodelImpl(javax.persistence.EntityManagerFactory emf)
public MetamodelImpl(EntityManagerSetupImpl emSetupImpl)
emSetupImpl
- public <X> javax.persistence.metamodel.EmbeddableType<X> embeddable(Class<X> clazz)
embeddable
in interface javax.persistence.metamodel.Metamodel
clazz
- the type of the represented embeddable classIllegalArgumentException
- if not an embeddable classpublic <X> javax.persistence.metamodel.EntityType<X> entity(Class<X> clazz)
entity
in interface javax.persistence.metamodel.Metamodel
clazz
- the type of the represented entityIllegalArgumentException
- if not an entitypublic List<javax.persistence.metamodel.Attribute> getAllManagedTypeAttributes()
public Set<javax.persistence.metamodel.EmbeddableType<?>> getEmbeddables()
getEmbeddables
in interface javax.persistence.metamodel.Metamodel
public Set<javax.persistence.metamodel.EntityType<?>> getEntities()
getEntities
in interface javax.persistence.metamodel.Metamodel
public Map<Class,ManagedTypeImpl<?>> getManagedTypesMap()
public Set<javax.persistence.metamodel.ManagedType<?>> getManagedTypes()
getManagedTypes
in interface javax.persistence.metamodel.Metamodel
public Set<MappedSuperclassTypeImpl<?>> getMappedSuperclasses()
public Project getProject()
public <X> TypeImpl<X> getType(Class<X> javaClass)
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.
javaClass
- public Map<Class,TypeImpl<?>> getTypes()
public <X> javax.persistence.metamodel.ManagedType<X> managedType(Class<X> clazz)
managedType
in interface javax.persistence.metamodel.Metamodel
clazz
- the type of the represented managed classIllegalArgumentException
- if not a managed classpublic void printAllTypes()
EclipseLink 2.5.2, "build v20140319-9ad6abd" API Reference