.keyColumnNames( getPropertyColumnNames( propertyIndex ) )
//does not set .collectionPersister as it does not make sense here for an entity
.session( session )
.propertyType( getPropertyTypes()[propertyIndex] )
.rowKeyColumnNames( buildRowKeyColumnNamesForStarToOne( this, getPropertyColumnNames( propertyIndex ) ) );
final Association ids = metadataProvider.getCollectionMetadataOrNull();
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(