public Object[] buildReferencesPKList(Object entity, Object attribute, AbstractSession session) {
ClassDescriptor referenceDescriptor = getReferenceDescriptor();
Object target = this.indirectionPolicy.getRealAttributeValueFromObject(entity, attribute);
Object[] result = new Object[1];
if (target != null){
CMPPolicy policy = referenceDescriptor.getCMPPolicy();
if (policy != null && policy.isCMP3Policy()) {
result[0] = policy.createPrimaryKeyInstance(target, session);
} else {
result[0] = referenceDescriptor.getObjectBuilder().extractPrimaryKeyFromObject(target, session);
}
}
return result;