Fix delete of entity with plural attributes

This commit is contained in:
Andrea Boriero 2019-11-27 10:53:35 +00:00
parent afb9f9770d
commit 6a403fa5d9
3 changed files with 3 additions and 6 deletions

View File

@ -91,6 +91,8 @@ public class DelayedCollectionAssembler implements DomainResultAssembler {
fetchedMapping.getCollectionDescriptor(),
parentAccess.getParentKey()
);
parentAccess.registerResolutionListener( owner -> instance.setOwner( owner ) );
}
@Override
@ -137,6 +139,7 @@ public class DelayedCollectionAssembler implements DomainResultAssembler {
@Override
public void finishUpRow(RowProcessingState rowProcessingState) {
collectionKey = null;
instance = null;
}

View File

@ -87,11 +87,6 @@ public class MapOperationTests {
}
@Test
@FailureExpected(
reason = "As noted in `#dropData` there is a problem with @ElementCollections not be handled properly " +
"for cascade; `org.hibernate.tuple.NonIdentifierAttribute#getCascadeStyle` returns CascadeStyles.NONE " +
"which leads to `EntityPersister#hasCascades` to report false which leads to Cascades skipping it"
)
public void testDelete(SessionFactoryScope scope) {
scope.inTransaction(
session -> {

View File

@ -110,7 +110,6 @@ public class SetOperationTests {
}
@Test
@FailureExpected( reason = "FlushVisitor collection handling" )
public void testDeleteWithElementCollectionData(SessionFactoryScope scope) {
scope.inTransaction(
session -> {