|
Hi,
I have exactly the same problem. After a quick analysis, the local variable joinable is not used for creating the association key. So I moved the call of getAssociatedJoinable method to a dedicated statement block. See the "next()" method patched code below.
Is anybody can you ensure me that this patch is correct and has no side effect ? Is that possible to integrate this patch in the next hibernate official revision ? Thanks.
@Override public AttributeDefinition next() { [...] if ( type.isAssociationType() ) { [...]
if ( aType.isAnyType() ) { associationKey = new AssociationKey( JoinHelper.getLHSTableName( aType, attributeNumber(), (OuterJoinLoadable) locateOwningPersister() ), JoinHelper.getLHSColumnNames( aType, attributeNumber(), columnPosition, (OuterJoinLoadable) locateOwningPersister(), sessionFactory() ) ); }
else { final Joinable joinable = aType.getAssociatedJoinable( sessionFactory() ); if ( aType.getForeignKeyDirection() == ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT ) { [...] }
else { [...] }
} [...] }
|