Package org.hibernate.metamodel.internal
Class MetadataContext
java.lang.Object
org.hibernate.metamodel.internal.MetadataContext
Defines a context for storing information during the building of the
MappingMetamodelImpl
.
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 getEmbeddableTypeSet()
results, which represent all the registered entities and
embeddables respectively.
-
Constructor Summary
ConstructorsConstructorDescriptionMetadataContext
(JpaMetamodelImplementor jpaMetamodel, MappingMetamodel mappingMetamodel, MetadataImplementor bootMetamodel, JpaStaticMetamodelPopulationSetting jpaStaticMetaModelPopulationSetting, JpaMetamodelPopulationSetting jpaMetaModelPopulationSetting, RuntimeModelCreationContext runtimeModelCreationContext) -
Method Summary
Modifier and TypeMethodDescriptiongetEmbeddableBootDescriptor
(EmbeddableDomainType<?> embeddableType) Map<Class<?>,
EntityDomainType<?>> Retrieves the java type toEntityTypeImpl
map.Map<Class<?>,
MappedSuperclassDomainType<?>> getPersistentClassHostingProperties
(MappedSuperclassTypeImpl<?> mappedSuperclassType) <J> EmbeddableDomainType<J>
locateEmbeddable
(Class<J> embeddableClass, Component component) locateEntityType
(Class<?> javaType) Given a JavaClass
, locate the corresponding JPAEntityType
.locateEntityType
(PersistentClass persistentClass) Given a HibernatePersistentClass
, locate the corresponding JPAEntityType
implementation.<E> IdentifiableDomainType<E>
locateIdentifiableType
(String entityName) Given an entity-name, locate the corresponding JPAEntityType
.locateMappedSuperclassType
(MappedSuperclass mappedSuperclass) Class<?>
metamodelClass
(ManagedDomainType<?> managedDomainType) void
popEntityWorkedOn
(PersistentClass persistentClass) void
pushEntityWorkedOn
(PersistentClass persistentClass) void
registerComponentByEmbeddable
(EmbeddableDomainType<?> embeddableType, Component bootDescriptor) void
registerEmbeddableType
(EmbeddableDomainType<?> embeddableType, Component bootDescriptor) void
registerEntityType
(PersistentClass persistentClass, EntityTypeImpl<?> entityType) void
registerMappedSuperclassType
(MappedSuperclass mappedSuperclass, MappedSuperclassDomainType<?> mappedSuperclassType) <J> BasicDomainType<J>
resolveBasicType
(Class<J> javaType) void
wrapUp()
-
Constructor Details
-
MetadataContext
public MetadataContext(JpaMetamodelImplementor jpaMetamodel, MappingMetamodel mappingMetamodel, MetadataImplementor bootMetamodel, JpaStaticMetamodelPopulationSetting jpaStaticMetaModelPopulationSetting, JpaMetamodelPopulationSetting jpaMetaModelPopulationSetting, RuntimeModelCreationContext runtimeModelCreationContext)
-
-
Method Details
-
getRuntimeModelCreationContext
-
getJpaMetamodel
-
getTypeConfiguration
-
getJavaTypeRegistry
-
getEntityTypeMap
Retrieves the java type toEntityTypeImpl
map.- Returns:
- The java type to
EntityTypeImpl
map.
-
getEmbeddableTypeSet
-
getMappedSuperclassTypeMap
-
registerEntityType
-
registerEmbeddableType
public void registerEmbeddableType(EmbeddableDomainType<?> embeddableType, Component bootDescriptor) -
registerComponentByEmbeddable
public void registerComponentByEmbeddable(EmbeddableDomainType<?> embeddableType, Component bootDescriptor) -
getEmbeddableBootDescriptor
-
registerMappedSuperclassType
public void registerMappedSuperclassType(MappedSuperclass mappedSuperclass, MappedSuperclassDomainType<?> mappedSuperclassType) -
locateEntityType
Given a HibernatePersistentClass
, locate the corresponding JPAEntityType
implementation. May return null if the givenPersistentClass
has not yet been processed.- Parameters:
persistentClass
- The Hibernate (config time) metamodel instance representing an entity.- Returns:
- Tne corresponding JPA
EntityType
, or null if not yet processed.
-
locateEntityType
Given a JavaClass
, locate the corresponding JPAEntityType
. May return null which could mean that no such mapping exists at least at this time.- Parameters:
javaType
- The java class.- Returns:
- The corresponding JPA
EntityType
, or null.
-
locateIdentifiableType
Given an entity-name, locate the corresponding JPAEntityType
. May return null which could means that no such mapping exists at least at this time.- Parameters:
entityName
- The entity-name.- Returns:
- The corresponding JPA
EntityType
, or null.
-
getIdentifiableTypesByName
-
wrapUp
public void wrapUp() -
metamodelClass
-
locateMappedSuperclassType
-
pushEntityWorkedOn
-
popEntityWorkedOn
-
getPersistentClassHostingProperties
public PersistentClass getPersistentClassHostingProperties(MappedSuperclassTypeImpl<?> mappedSuperclassType) -
getUnusedMappedSuperclasses
-
resolveBasicType
-
locateEmbeddable
-