.associationKeyMetadata( associationKeyMetadata )
.session( session )
.associationTypeContext( associationTypeContext )
.hostingEntity( session.getPersistenceContext().getEntity( new org.hibernate.engine.spi.EntityKey( (Serializable) uniqueKey, inversePersister ) ) );
final Association ids = associationPersister.getAssociationOrNull();
if (ids == null || ids.size() == 0 ) {
return null;
}
else if (ids.size() == 1) {
//EntityLoader#loadByUniqueKey uses a null object and LockMode.NONE
//there is only one element in the list, so get the first
Tuple tuple = ids.get( ids.getKeys().iterator().next() );
final Serializable id = (Serializable) getGridIdentifierType().nullSafeGet( tuple, getIdentifierColumnNames(), session, null );
return load( id, null, LockMode.NONE, session );
}
else {
throw new AssertionFailure(