HHH-17964 Hibernate using wrong column order for ElementCollection query when composite ID is present
This commit is contained in:
parent
06fe05482c
commit
40f6ad6700
|
@ -736,14 +736,20 @@ public class TableBinder {
|
|||
PersistentClass referencedEntity,
|
||||
AnnotatedJoinColumns joinColumns,
|
||||
SimpleValue value) {
|
||||
final List<Column> idColumns = referencedEntity instanceof JoinedSubclass
|
||||
? referencedEntity.getKey().getColumns()
|
||||
: referencedEntity.getIdentifier().getColumns();
|
||||
final KeyValue keyValue = referencedEntity instanceof JoinedSubclass
|
||||
? referencedEntity.getKey()
|
||||
: referencedEntity.getIdentifier();
|
||||
final List<Column> idColumns = keyValue.getColumns();
|
||||
for ( Column column: idColumns ) {
|
||||
final AnnotatedJoinColumn firstColumn = joinColumns.getJoinColumns().get(0);
|
||||
firstColumn.linkValueUsingDefaultColumnNaming( column, referencedEntity, value);
|
||||
firstColumn.overrideFromReferencedColumnIfNecessary( column );
|
||||
}
|
||||
if ( keyValue instanceof Component
|
||||
&& ( (Component) keyValue ).isSorted()
|
||||
&& value instanceof DependantValue ) {
|
||||
( (DependantValue) value ).setSorted( true );
|
||||
}
|
||||
}
|
||||
|
||||
private static void bindUnownedAssociation(
|
||||
|
|
Loading…
Reference in New Issue