HHH-11576 - Process unfetched collections on Flushvisitor to determine reachability

This commit is contained in:
barreiro 2017-03-18 02:58:24 +00:00 committed by Gail Badner
parent 8f495505e5
commit a5c7087316
1 changed files with 9 additions and 0 deletions

View File

@ -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;