mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-18 17:15:02 +00:00
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;
|
package org.hibernate.event.internal;
|
||||||
|
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
|
import org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer;
|
||||||
import org.hibernate.collection.spi.PersistentCollection;
|
import org.hibernate.collection.spi.PersistentCollection;
|
||||||
import org.hibernate.engine.internal.Collections;
|
import org.hibernate.engine.internal.Collections;
|
||||||
import org.hibernate.event.spi.EventSource;
|
import org.hibernate.event.spi.EventSource;
|
||||||
@ -35,6 +36,9 @@ Object processCollection(Object collection, CollectionType type)
|
|||||||
if ( type.hasHolder() ) {
|
if ( type.hasHolder() ) {
|
||||||
coll = getSession().getPersistenceContext().getCollectionHolder(collection);
|
coll = getSession().getPersistenceContext().getCollectionHolder(collection);
|
||||||
}
|
}
|
||||||
|
else if ( collection == LazyPropertyInitializer.UNFETCHED_PROPERTY ) {
|
||||||
|
coll = (PersistentCollection) type.resolve( collection, getSession(), owner );
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
coll = (PersistentCollection) collection;
|
coll = (PersistentCollection) collection;
|
||||||
}
|
}
|
||||||
@ -46,6 +50,11 @@ Object processCollection(Object collection, CollectionType type)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
boolean includeEntityProperty(Object[] values, int i) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
FlushVisitor(EventSource session, Object owner) {
|
FlushVisitor(EventSource session, Object owner) {
|
||||||
super(session);
|
super(session);
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user