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:
Yoann Rodière 2018-07-12 16:32:54 +02:00 committed by Guillaume Smet
parent 47107e3e88
commit e53e0ef790
2 changed files with 1 additions and 15 deletions

View File

@ -333,19 +333,7 @@ public class DefaultFlushEntityEventListener implements FlushEntityEventListener
//now we might need to recalculate the dirtyProperties array
if ( intercepted && event.isDirtyCheckPossible() ) {
if ( !event.isDirtyCheckHandledByInterceptor() ) {
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 );
}
dirtyCheck( event );
}
return intercepted;

View File

@ -18,7 +18,6 @@ import org.hibernate.cfg.Configuration;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.type.Type;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
@ -76,7 +75,6 @@ public class CustomDirtinessStrategyTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpected(jiraKey = "HHH-12718")
public void testCustomStrategyWithFlushInterceptor() {
Session session = openSession();
session.beginTransaction();