HHH-10891 Support @Any in @Embedded

(cherry picked from commit 64179673a3)
This commit is contained in:
Keshavan Santhanam 2018-10-31 16:53:26 +05:30 committed by Gail Badner
parent e20d66ad49
commit 56f67fb0cd
1 changed files with 4 additions and 1 deletions

View File

@ -92,7 +92,6 @@ public abstract class AbstractCompositionAttribute
// we build the association-key here because of the "goofiness" with 'currentColumnPosition'
final AssociationKey associationKey;
final AssociationType aType = (AssociationType) type;
final Joinable joinable = aType.getAssociatedJoinable( sessionFactory() );
if ( aType.isAnyType() ) {
associationKey = new AssociationKey(
@ -111,6 +110,8 @@ public abstract class AbstractCompositionAttribute
);
}
else if ( aType.getForeignKeyDirection() == ForeignKeyDirection.FROM_PARENT ) {
final Joinable joinable = aType.getAssociatedJoinable( sessionFactory() );
final String lhsTableName;
final String[] lhsColumnNames;
@ -133,6 +134,8 @@ public abstract class AbstractCompositionAttribute
associationKey = new AssociationKey( lhsTableName, lhsColumnNames );
}
else {
final Joinable joinable = aType.getAssociatedJoinable( sessionFactory() );
associationKey = new AssociationKey(
joinable.getTableName(),
getRHSColumnNames( aType, sessionFactory() )