// We need to update the pk field to be to our table.
pkField = (DatabaseField) pkField.clone();
pkField.setTable(getDescriptor().getPrimaryTable());
}
mapping.addTargetForeignKeyField(fkField, pkField);
}
}
} else {
// If improper mapping encountered, throw an exception.
throw ValidationException.invalidMapping(getJavaClass(), getReferenceClass());