HHH-12718 Compute dirtiness using whatever method is appropriate after a flush event interception
We used to have a simpler version of the dirtyCheck() method after an interception, but that's not enough.
This commit is contained in:
parent
47107e3e88
commit
e53e0ef790
|
@ -333,19 +333,7 @@ public class DefaultFlushEntityEventListener implements FlushEntityEventListener
|
||||||
|
|
||||||
//now we might need to recalculate the dirtyProperties array
|
//now we might need to recalculate the dirtyProperties array
|
||||||
if ( intercepted && event.isDirtyCheckPossible() ) {
|
if ( intercepted && event.isDirtyCheckPossible() ) {
|
||||||
if ( !event.isDirtyCheckHandledByInterceptor() ) {
|
dirtyCheck( event );
|
||||||
int[] dirtyProperties;
|
|
||||||
if ( event.hasDatabaseSnapshot() ) {
|
|
||||||
dirtyProperties = persister.findModified( event.getDatabaseSnapshot(), values, entity, session );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dirtyProperties = persister.findDirty( values, entry.getLoadedState(), entity, session );
|
|
||||||
}
|
|
||||||
event.setDirtyProperties( dirtyProperties );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dirtyCheck( event );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return intercepted;
|
return intercepted;
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.hibernate.cfg.Configuration;
|
||||||
import org.hibernate.persister.entity.EntityPersister;
|
import org.hibernate.persister.entity.EntityPersister;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
|
|
||||||
import org.hibernate.testing.FailureExpected;
|
|
||||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -76,7 +75,6 @@ public class CustomDirtinessStrategyTest extends BaseCoreFunctionalTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@FailureExpected(jiraKey = "HHH-12718")
|
|
||||||
public void testCustomStrategyWithFlushInterceptor() {
|
public void testCustomStrategyWithFlushInterceptor() {
|
||||||
Session session = openSession();
|
Session session = openSession();
|
||||||
session.beginTransaction();
|
session.beginTransaction();
|
||||||
|
|
Loading…
Reference in New Issue