HHH-17965 @ElementCollection with @CollectionTable throws o.h.MappingException Foreign key must have same number of columns as the referenced primary key

This commit is contained in:
Andrea Boriero 2024-04-20 15:10:40 +02:00 committed by Christian Beikov
parent a3690b1e68
commit 42cbbc3a0c
1 changed files with 18 additions and 18 deletions

View File

@ -84,7 +84,6 @@ public class Set extends Collection {
PrimaryKey pk = collectionTable.getPrimaryKey();
if ( pk == null ) {
pk = new PrimaryKey( getCollectionTable() );
}
pk.addColumns( getKey() );
for ( Selectable selectable : getElement().getSelectables() ) {
if ( selectable instanceof Column ) {
@ -106,6 +105,7 @@ public class Set extends Collection {
//TODO: create an implicit not null constraint on all cols?
// }
}
}
// else {
//create an index on the key columns??
// }