If a getter is marked @Transient, be a bit more quiet about compliance warnings.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@567897 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Patrick Linskey 2007-08-21 01:28:12 +00:00
parent 8c28c6bcbd
commit b0c5cfe69a
1 changed files with 8 additions and 2 deletions

View File

@ -296,12 +296,13 @@ public class PersistenceMetaDataDefaults
meta.getDescribedType(), "set" +
StringUtils.capitalize(name), new Class[] {
((Method) member).getReturnType() }));
if (setter == null) {
if (setter == null && !isAnnotatedTransient(member)) {
logNoSetter(meta, name, null);
return false;
}
} catch (Exception e) {
// e.g., NoSuchMethodException
if (!isAnnotatedTransient(member))
logNoSetter(meta, name, e);
return false;
}
@ -313,6 +314,11 @@ public class PersistenceMetaDataDefaults
return true;
}
private boolean isAnnotatedTransient(Member member) {
return member instanceof AnnotatedElement
&& ((AnnotatedElement) member).isAnnotationPresent(Transient.class);
}
private void logNoSetter(ClassMetaData meta, String name, Exception e) {
Log log = meta.getRepository().getConfiguration()
.getLog(OpenJPAConfiguration.LOG_METADATA);