* INTERNAL:
* Return the accessible field for the given mapping accessor. Validation is
* performed on the existence of the field.
*/
protected MetadataField getAccessibleField(MappingAccessor accessor) {
MetadataField field = getJavaClass().getField(accessor.getName());
if (field == null) {
throw ValidationException.invalidFieldForClass(accessor.getName(), getJavaClass());
} else {
// True will force an exception to be thrown if it is not a valid
// field. However, if it is a transient accessor, don't validate it
// and return.
if (accessor.isTransient() || field.isValidPersistenceField(this, true)) {
return field;
}
return null;
}