mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-10837 - with jpaMetaModelPopulationSetting.DISABLED the MetadataContext is not created
This commit is contained in:
parent
248d9cca14
commit
1558eb73a6
@ -205,17 +205,18 @@ public MetadataImplementor getMetadata() {
|
|||||||
}
|
}
|
||||||
collectionPersisterMap.values().forEach( CollectionPersister::postInstantiate );
|
collectionPersisterMap.values().forEach( CollectionPersister::postInstantiate );
|
||||||
|
|
||||||
|
if ( jpaMetaModelPopulationSetting != JpaMetaModelPopulationSetting.DISABLED ) {
|
||||||
MetadataContext context = new MetadataContext(
|
MetadataContext context = new MetadataContext(
|
||||||
sessionFactory,
|
sessionFactory,
|
||||||
mappingMetadata.getMappedSuperclassMappingsCopy(),
|
mappingMetadata.getMappedSuperclassMappingsCopy(),
|
||||||
jpaMetaModelPopulationSetting
|
jpaMetaModelPopulationSetting
|
||||||
);
|
);
|
||||||
if ( jpaMetaModelPopulationSetting != JpaMetaModelPopulationSetting.DISABLED ) {
|
|
||||||
for ( PersistentClass entityBinding : mappingMetadata.getEntityBindings() ) {
|
for ( PersistentClass entityBinding : mappingMetadata.getEntityBindings() ) {
|
||||||
locateOrBuildEntityType( entityBinding, context );
|
locateOrBuildEntityType( entityBinding, context );
|
||||||
}
|
}
|
||||||
handleUnusedMappedSuperclasses( context );
|
handleUnusedMappedSuperclasses( context );
|
||||||
}
|
|
||||||
context.wrapUp();
|
context.wrapUp();
|
||||||
|
|
||||||
this.jpaEntityTypeMap.putAll( context.getEntityTypeMap() );
|
this.jpaEntityTypeMap.putAll( context.getEntityTypeMap() );
|
||||||
@ -224,6 +225,7 @@ public MetadataImplementor getMetadata() {
|
|||||||
this.jpaEntityTypesByEntityName.putAll( context.getEntityTypesByEntityName() );
|
this.jpaEntityTypesByEntityName.putAll( context.getEntityTypesByEntityName() );
|
||||||
|
|
||||||
applyNamedEntityGraphs( mappingMetadata.getNamedEntityGraphs().values() );
|
applyNamedEntityGraphs( mappingMetadata.getNamedEntityGraphs().values() );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user