HHH-11576 - Process unfetched collections on Flushvisitor to determine reachability
This commit is contained in:
parent
8f495505e5
commit
a5c7087316
|
@ -7,6 +7,7 @@
|
|||
package org.hibernate.event.internal;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer;
|
||||
import org.hibernate.collection.spi.PersistentCollection;
|
||||
import org.hibernate.engine.internal.Collections;
|
||||
import org.hibernate.event.spi.EventSource;
|
||||
|
@ -35,6 +36,9 @@ public class FlushVisitor extends AbstractVisitor {
|
|||
if ( type.hasHolder() ) {
|
||||
coll = getSession().getPersistenceContext().getCollectionHolder(collection);
|
||||
}
|
||||
else if ( collection == LazyPropertyInitializer.UNFETCHED_PROPERTY ) {
|
||||
coll = (PersistentCollection) type.resolve( collection, getSession(), owner );
|
||||
}
|
||||
else {
|
||||
coll = (PersistentCollection) collection;
|
||||
}
|
||||
|
@ -46,6 +50,11 @@ public class FlushVisitor extends AbstractVisitor {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean includeEntityProperty(Object[] values, int i) {
|
||||
return true;
|
||||
}
|
||||
|
||||
FlushVisitor(EventSource session, Object owner) {
|
||||
super(session);
|
||||
this.owner = owner;
|
||||
|
|
Loading…
Reference in New Issue