* setting and for a field to be processed it must have a Access(FIELD)
* setting.
*/
protected void processAccessorFields(boolean processingInverse) {
for (Field field : MetadataHelper.getFields(getJavaClass())) {
MetadataField metadataField = new MetadataField(field, getLogger());
if (metadataField.isAnnotationPresent(Transient.class)) {
if (metadataField.hasMoreThanOneDeclaredAnnotation(getDescriptor())) {
throw ValidationException.mappingAnnotationsAppliedToTransientAttribute(field);
}
} else {
// The is valid check will throw an exception if needed.
if (metadataField.isValidPersistenceField(processingInverse, getDescriptor())) {
// If the accessor already exists, it may have come from XML
// or because of an explicit access type setting. E.G.
// Access type is property and we processed the access
// methods for this field, however the field has been tagged
// as access field. We must therefore overwrite the previous
// accessor with this explicit one.
if (! getDescriptor().hasAccessorFor(metadataField.getAttributeName()) || (getDescriptor().hasAccessorFor(metadataField.getAttributeName()) && processingInverse)) {
getDescriptor().addAccessor(buildAccessor(metadataField));
}
}
}
}