public IgniteCache<Object, BinaryObject> getAssociationCache(AssociationKeyMetadata keyMetadata) { return keyMetadata.getAssociationKind() == AssociationKind.EMBEDDED_COLLECTION ? getEntityCache( keyMetadata.getEntityKeyMetadata() ) : getEntityCache( keyMetadata.getTable() ); }
private void removeNavigationalInformationFromInverseSide(int propertyIndex, AssociationKeyMetadata associationKeyMetadata, Object[] oldColumnValue) { // If the association involves entities deleted by a previous operation of the current batch, // it does not make sense trying to update association itself EntityKey entityKey = new EntityKey( associationKeyMetadata.getEntityKeyMetadata(), oldColumnValue ); if ( gridDialect instanceof BatchOperationsDelegator && ( (BatchOperationsDelegator) gridDialect ).isMarkedForRemoval( entityKey ) ) { return; } AssociationPersister associationPersister = createInverseAssociationPersister( propertyIndex, associationKeyMetadata, oldColumnValue ); Association association = associationPersister.getAssociationOrNull(); // The association might be empty if the navigation information have already been removed. // This typically happens when the entity owning the inverse association has already been deleted prior to // deleting the entity owning the association and a {@code @NotFound(action = NotFoundAction.IGNORE)} is // involved. if ( association != null && !association.isEmpty() ) { RowKey rowKey = getInverseRowKey( associationKeyMetadata, oldColumnValue ); association.remove( rowKey ); associationPersister.flushToDatastore(); } }