class MetadataContext extends Object
MetamodelImpl.
This contextual information includes data needing to be processed in a second pass as well as
cross-references into the built metamodel classes.
At the end of the day, clients are interested in the getEntityTypeMap() and getEmbeddableTypeMap()
results, which represent all the registered entities and
embeddables respectively.| 构造器和说明 |
|---|
MetadataContext(SessionFactory sessionFactory,
Set<javax.persistence.MappedSuperclass> mappedSuperclasses) |
| 限定符和类型 | 方法和说明 |
|---|---|
Map<Class<?>,EmbeddableTypeImpl<?>> |
getEmbeddableTypeMap() |
Map<Class<?>,EntityTypeImpl<?>> |
getEntityTypeMap()
Retrieves the java type to
EntityTypeImpl map. |
Map<String,EntityTypeImpl<?>> |
getEntityTypesByEntityName() |
Map<Class<?>,javax.persistence.metamodel.MappedSuperclassType<?>> |
getMappedSuperclassTypeMap() |
(专用程序包) SessionFactory |
getSessionFactory() |
Set<javax.persistence.MappedSuperclass> |
getUnusedMappedSuperclasses() |
EntityTypeImpl<?> |
locateEntityType(Class<?> javaType)
Given a Java
Class, locate the corresponding JPA org.hibernate.type.EntityType. |
EntityTypeImpl<?> |
locateEntityType(PersistentClass persistentClass)
Given a Hibernate
PersistentClass, locate the corresponding JPA org.hibernate.type.EntityType
implementation. |
EntityTypeImpl<?> |
locateEntityType(String entityName)
Given an entity-name, locate the corresponding JPA
org.hibernate.type.EntityType. |
void |
pushEntityWorkedOn(PersistentClass persistentClass) |
(专用程序包) void |
registerEmbeddedableType(EmbeddableTypeImpl<?> embeddableType) |
(专用程序包) void |
registerEntityType(PersistentClass persistentClass,
EntityTypeImpl<?> entityType) |
public MetadataContext(SessionFactory sessionFactory, Set<javax.persistence.MappedSuperclass> mappedSuperclasses)
SessionFactory getSessionFactory()
public Map<Class<?>,EntityTypeImpl<?>> getEntityTypeMap()
EntityTypeImpl map.EntityTypeImpl map.public Map<Class<?>,EmbeddableTypeImpl<?>> getEmbeddableTypeMap()
public Map<Class<?>,javax.persistence.metamodel.MappedSuperclassType<?>> getMappedSuperclassTypeMap()
void registerEntityType(PersistentClass persistentClass, EntityTypeImpl<?> entityType)
void registerEmbeddedableType(EmbeddableTypeImpl<?> embeddableType)
public EntityTypeImpl<?> locateEntityType(PersistentClass persistentClass)
PersistentClass, locate the corresponding JPA org.hibernate.type.EntityType
implementation. May retur null if the given PersistentClass has not yet been processed.persistentClass - The Hibernate (config time) metamodel instance representing an entity.org.hibernate.type.EntityType, or null if not yet processed.public EntityTypeImpl<?> locateEntityType(Class<?> javaType)
Class, locate the corresponding JPA org.hibernate.type.EntityType. May
return null which could means that no such mapping exists at least at this time.javaType - The java class.org.hibernate.type.EntityType, or null.public EntityTypeImpl<?> locateEntityType(String entityName)
org.hibernate.type.EntityType. May
return null which could means that no such mapping exists at least at this time.entityName - The entity-name.org.hibernate.type.EntityType, or null.public Map<String,EntityTypeImpl<?>> getEntityTypesByEntityName()
public void pushEntityWorkedOn(PersistentClass persistentClass)
public Set<javax.persistence.MappedSuperclass> getUnusedMappedSuperclasses()
Copyright © 2019. All rights reserved.