HHH-16031 @ManyToMany with @JoinTable(inverseColumn = ...) and SortedSet may results in data loss

This commit is contained in:
Andrea Boriero 2023-01-16 14:03:58 +01:00 committed by Christian Beikov
parent 241fe54d0a
commit f4aec1cd0a
2 changed files with 3 additions and 5 deletions

View File

@ -404,13 +404,14 @@ public class AnnotatedJoinColumn extends AnnotatedColumn {
PropertyData inferredData) {
final AnnotatedJoinColumn column = new AnnotatedJoinColumn();
column.setImplicit( true );
column.setNullable( false ); //I break the spec, but it's for good
// column.setPropertyHolder( propertyHolder );
// column.setPropertyName( getRelativePath( propertyHolder, propertyName ) );
// column.setJoins( secondaryTables );
// column.setContext( context );
column.setParent( parent );
column.bind();
column.setNullable( false ); //I break the spec, but it's for good
return column;
}
@ -425,11 +426,11 @@ public class AnnotatedJoinColumn extends AnnotatedColumn {
// column.setPropertyName( getRelativePath( propertyHolder, propertyName ) );
// column.setJoins( secondaryTables );
// column.setContext( context );
column.setNullable( false ); //I break the spec, but it's for good
//done after the annotation to override it
column.setParent( parent );
column.applyJoinAnnotation( joinColumn, inferredData.getPropertyName() );
column.bind();
column.setNullable( false ); //I break the spec, but it's for good
return column;
}

View File

@ -14,7 +14,6 @@ import org.hibernate.orm.test.envers.Priority;
import org.hibernate.orm.test.envers.entities.StrTestEntity;
import org.hibernate.orm.test.envers.entities.manytomany.unidirectional.JoinTableEntity;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.TestForIssue;
import org.junit.Assert;
import org.junit.Test;
@ -100,7 +99,6 @@ public class JoinTableDetachedTest extends BaseEnversJPAFunctionalTestCase {
}
@Test
@FailureExpected( jiraKey = "HHH-15393", message = "Work for HHH-15393 (write-paths) causes a failure" )
public void testRevisionsCounts() {
Assert.assertEquals(
Arrays.asList( 1, 2, 3, 4, 5 ), getAuditReader().getRevisions(
@ -113,7 +111,6 @@ public class JoinTableDetachedTest extends BaseEnversJPAFunctionalTestCase {
}
@Test
@FailureExpected( jiraKey = "HHH-15393", message = "Work for HHH-15393 (write-paths) causes a failure" )
public void testHistoryOfCollectionEntity() {
// Revision 1
JoinTableEntity collectionEntity = new JoinTableEntity( collectionEntityId, "some data" );