Package org.hibernate.metamodel.internal
Class MetadataContext
- java.lang.Object
-
- org.hibernate.metamodel.internal.MetadataContext
-
@Internal public class MetadataContext extends Object
Defines a context for storing information during the building of theMappingMetamodelImpl
.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()
andgetEmbeddableTypeSet()
results, which represent all the registered entities and embeddables respectively.
-
-
Constructor Summary
Constructors Constructor Description MetadataContext(JpaMetamodelImplementor jpaMetamodel, MappingMetamodel mappingMetamodel, MetadataImplementor bootMetamodel, JpaStaticMetaModelPopulationSetting jpaStaticMetaModelPopulationSetting, JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting, RuntimeModelCreationContext runtimeModelCreationContext)
-
Method Summary
-
-
-
Constructor Detail
-
MetadataContext
public MetadataContext(JpaMetamodelImplementor jpaMetamodel, MappingMetamodel mappingMetamodel, MetadataImplementor bootMetamodel, JpaStaticMetaModelPopulationSetting jpaStaticMetaModelPopulationSetting, JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting, RuntimeModelCreationContext runtimeModelCreationContext)
-
-
Method Detail
-
getRuntimeModelCreationContext
public RuntimeModelCreationContext getRuntimeModelCreationContext()
-
getJpaMetamodel
public JpaMetamodelImplementor getJpaMetamodel()
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
-
getJavaTypeRegistry
public JavaTypeRegistry getJavaTypeRegistry()
-
getEntityTypeMap
public Map<Class<?>,EntityDomainType<?>> getEntityTypeMap()
Retrieves the java type toEntityTypeImpl
map.- Returns:
- The java type to
EntityTypeImpl
map.
-
getEmbeddableTypeSet
public Set<EmbeddableDomainType<?>> getEmbeddableTypeSet()
-
getMappedSuperclassTypeMap
public Map<Class<?>,MappedSuperclassDomainType<?>> getMappedSuperclassTypeMap()
-
registerEntityType
public void registerEntityType(PersistentClass persistentClass, EntityTypeImpl<?> entityType)
-
registerEmbeddableType
public void registerEmbeddableType(EmbeddableDomainType<?> embeddableType, Component bootDescriptor)
-
registerComponentByEmbeddable
public void registerComponentByEmbeddable(EmbeddableDomainType<?> embeddableType, Component bootDescriptor)
-
getEmbeddableBootDescriptor
public Component getEmbeddableBootDescriptor(EmbeddableDomainType<?> embeddableType)
-
registerMappedSuperclassType
public void registerMappedSuperclassType(MappedSuperclass mappedSuperclass, MappedSuperclassDomainType<?> mappedSuperclassType)
-
locateEntityType
public EntityDomainType<?> locateEntityType(PersistentClass persistentClass)
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
public EntityDomainType<?> locateEntityType(Class<?> javaType)
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
public <E> IdentifiableDomainType<E> locateIdentifiableType(String entityName)
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
public Map<String,IdentifiableDomainType<?>> getIdentifiableTypesByName()
-
wrapUp
public void wrapUp()
-
locateMappedSuperclassType
public MappedSuperclassDomainType<?> locateMappedSuperclassType(MappedSuperclass mappedSuperclass)
-
pushEntityWorkedOn
public void pushEntityWorkedOn(PersistentClass persistentClass)
-
popEntityWorkedOn
public void popEntityWorkedOn(PersistentClass persistentClass)
-
getPersistentClassHostingProperties
public PersistentClass getPersistentClassHostingProperties(MappedSuperclassTypeImpl<?> mappedSuperclassType)
-
getUnusedMappedSuperclasses
public Set<MappedSuperclass> getUnusedMappedSuperclasses()
-
resolveBasicType
public <J> BasicDomainType<J> resolveBasicType(Class<J> javaType)
-
locateEmbeddable
public <J> EmbeddableDomainType<J> locateEmbeddable(Class<J> embeddableClass, Component component)
-
-