private void doRemovePropertyMetadata(Cache<AssociationKey, List<Map<String,Object>>> associationCache,
int tableIndex,
int propertyIndex,
Object[] oldColumnValue) {
PropertyMetadataProvider metadataProvider = new PropertyMetadataProvider()
.associationCache( associationCache )
.keyColumnNames( persister.getPropertyColumnNames( propertyIndex ) )
.columnValues( oldColumnValue )
.session( session )
.tableName( persister.getTableName( tableIndex ) );
Map<String,Object> idTuple = getTupleKey();
List<Map<String,Object>> propertyValues = metadataProvider.getCollectionMetadata();
if ( propertyValues != null ) {
//Map's equals operation delegates to all it's key and value, should be fine for now
final Map<String, Object> matchingTuple = metadataProvider.findMatchingTuple( idTuple );
//TODO what should we do if that's null?
if (matchingTuple != null) {
metadataProvider.getCollectionMetadata().remove( matchingTuple );
}
metadataProvider.flushToCache();
}
}