/**
* Prepare a cascade locking policy.
*/
public void prepareCascadeLockingPolicy() {
CascadeLockingPolicy policy = new CascadeLockingPolicy(getDescriptor(), getReferenceDescriptor());
policy.setQueryKeyFields(getSourceKeysToTargetForeignKeys());
policy.setShouldHandleUnmappedFields(true);
getReferenceDescriptor().addCascadeLockingPolicy(policy);
}