HHH-13640 : Correct DefaultLoadEventListener#proxyOrLoad to work properly enhancement but no HibernateProxy factory
This commit is contained in:
parent
8ce4d36787
commit
57befd1a08
|
@ -319,15 +319,18 @@ public class DefaultLoadEventListener extends AbstractLockUpgradeEventListener i
|
||||||
return createProxy( event, persister, keyToLoad, persistenceContext );
|
return createProxy( event, persister, keyToLoad, persistenceContext );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( !entityMetamodel.hasSubclasses() ) {
|
||||||
|
if ( keyToLoad.isBatchLoadable() ) {
|
||||||
|
// Add a batch-fetch entry into the queue for this entity
|
||||||
|
persistenceContext.getBatchFetchQueue().addBatchLoadableEntityKey( keyToLoad );
|
||||||
|
}
|
||||||
|
|
||||||
if ( keyToLoad.isBatchLoadable() ) {
|
// This is the crux of HHH-11147
|
||||||
// Add a batch-fetch entry into the queue for this entity
|
// create the (uninitialized) entity instance - has only id set
|
||||||
persistenceContext.getBatchFetchQueue().addBatchLoadableEntityKey( keyToLoad );
|
return persister.getBytecodeEnhancementMetadata().createEnhancedProxy( keyToLoad, true, session );
|
||||||
}
|
}
|
||||||
|
// If we get here, then the entity class has subclasses and there is no HibernateProxy factory.
|
||||||
// This is the crux of HHH-11147
|
// The entity will get loaded below.
|
||||||
// create the (uninitialized) entity instance - has only id set
|
|
||||||
return persister.getBytecodeEnhancementMetadata().createEnhancedProxy( keyToLoad, true, session );
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( persister.hasProxy() ) {
|
if ( persister.hasProxy() ) {
|
||||||
|
|
Loading…
Reference in New Issue