HHH-17964 Hibernate using wrong column order for ElementCollection query when composite ID is present
This commit is contained in:
parent
a1739979d1
commit
2202487633
|
@ -743,9 +743,10 @@ 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 ( int i = 0; i < idColumns.size(); i++ ) {
|
||||
final Column column = idColumns.get(i);
|
||||
final AnnotatedJoinColumn firstColumn = joinColumns.getJoinColumns().get(0);
|
||||
|
@ -767,6 +768,11 @@ public class TableBinder {
|
|||
}
|
||||
}
|
||||
}
|
||||
if ( keyValue instanceof Component
|
||||
&& ( (Component) keyValue ).isSorted()
|
||||
&& value instanceof DependantValue ) {
|
||||
( (DependantValue) value ).setSorted( true );
|
||||
}
|
||||
}
|
||||
|
||||
private static void bindUnownedAssociation(
|
||||
|
|
Loading…
Reference in New Issue