.keyGridType( gridUniqueKeyType )
//does not set .collectionPersister as it does not make sense here for an entity
.associationKeyMetadata( associationKeyMetadata )
.session( session )
.propertyType( getPropertyTypes()[propertyIndex] );
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(