mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-13633 : Bugs join-fetching a collection when scrolling with a stateless session using enhancement as proxy
Minor changes suggested by Andrea.
This commit is contained in:
parent
b589251166
commit
cce634f03b
@ -299,14 +299,6 @@ public Object internalLoad(
|
||||
// caller did not request forceful eager loading, see if we can create
|
||||
// some form of proxy
|
||||
|
||||
final boolean allowBytecodeProxy = getFactory()
|
||||
.getSessionFactoryOptions()
|
||||
.isEnhancementAsProxyEnabled();
|
||||
|
||||
final boolean entityHasHibernateProxyFactory = persister.getEntityMetamodel()
|
||||
.getTuplizer()
|
||||
.getProxyFactory() != null;
|
||||
|
||||
// first, check to see if we can use "bytecode proxies"
|
||||
|
||||
final EntityMetamodel entityMetamodel = persister.getEntityMetamodel();
|
||||
@ -315,7 +307,7 @@ public Object internalLoad(
|
||||
|
||||
// if the entity defines a HibernateProxy factory, see if there is an
|
||||
// existing proxy associated with the PC - and if so, use it
|
||||
if ( entityHasHibernateProxyFactory ) {
|
||||
if ( persister.getEntityMetamodel().getTuplizer().getProxyFactory() != null ) {
|
||||
final PersistenceContext persistenceContext = getPersistenceContext();
|
||||
final Object proxy = persistenceContext.getProxy( entityKey );
|
||||
|
||||
@ -331,7 +323,7 @@ public Object internalLoad(
|
||||
}
|
||||
|
||||
// specialized handling for entities with subclasses with a HibernateProxy factory
|
||||
if ( persister.getEntityMetamodel().hasSubclasses() ) {
|
||||
if ( entityMetamodel.hasSubclasses() ) {
|
||||
// entities with subclasses that define a ProxyFactory can create
|
||||
// a HibernateProxy.
|
||||
LOG.debugf( "Creating a HibernateProxy for to-one association with subclasses to honor laziness" );
|
||||
|
Loading…
x
Reference in New Issue
Block a user