.associationKeyMetadata( associationKeyMetadata )
.keyColumnValues( newColumnValue )
.session( session )
//does not set .collectionPersister as it does not make sense here for a ToOne or a unique key
.propertyType( persister.getPropertyTypes()[propertyIndex] );
Tuple tuple = new Tuple();
//add the id column
final String[] identifierColumnNames = persister.getIdentifierColumnNames();
gridIdentifierType.nullSafeSet( tuple, id, identifierColumnNames, session );
//add the fk column
gridPropertyTypes[propertyIndex].nullSafeSet(
tuple,
fields[propertyIndex],
propertyColumnNames,
includeColumns[propertyIndex],
session
);
Object[] columnValues = LogicalPhysicalConverterHelper.getColumnValuesFromResultset( tuple, rowKeyColumnNames );
EntityKey targetKey = associationPersister.createTargetKey( rowKeyColumnNames, columnValues );
final RowKey rowKey = new RowKey( persister.getTableName(), rowKeyColumnNames, columnValues, targetKey );
Tuple assocEntryTuple = associationPersister.createAndPutAssociationTuple( rowKey );
for ( String column : tuple.getColumnNames() ) {
assocEntryTuple.put( column, tuple.get( column ) );
}
associationPersister.flushToCache();
}