if (getReferenceDescriptor() != null) {
referenceDescriptor.setCacheIsolation(descriptor.getCacheIsolation());
// Changed as part of fix for bug#4410581 aggregate mapping can not be set to use change tracking if owning descriptor does not use it.
// Basically the policies should be the same, but we also allow deferred with attribute for CMP2 (courser grained).
if (getDescriptor().getObjectChangePolicy().getClass().equals(DeferredChangeDetectionPolicy.class)) {
getReferenceDescriptor().setObjectChangePolicy(new DeferredChangeDetectionPolicy());
} else if (getDescriptor().getObjectChangePolicy().getClass().equals(ObjectChangeTrackingPolicy.class)
&& getReferenceDescriptor().getObjectChangePolicy().getClass().equals(AttributeChangeTrackingPolicy.class)) {
getReferenceDescriptor().setObjectChangePolicy(new ObjectChangeTrackingPolicy());
}