// idea of the destination is the destination table.
String tableAlias = fromClause.getAliasGenerator().createName( entityPersister.getEntityName() );
String[] secondJoinColumns = sfh.getCollectionElementColumns( role, roleAlias );
// Add the second join, the one that ends in the destination table.
JoinSequence joinSequence = createJoinSequence( roleAlias, joinType );
joinSequence.addJoin( sfh.getElementAssociationType( collectionType ), tableAlias, joinType, secondJoinColumns );
elem = createJoin( associatedEntityName, tableAlias, joinSequence, type, false );
elem.setUseFromFragment( true );
}
return elem;
}