mirror of https://github.com/apache/openjpa.git
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:
parent
8c28c6bcbd
commit
b0c5cfe69a
openjpa-persistence/src/main/java/org/apache/openjpa/persistence
|
@ -296,13 +296,14 @@ public class PersistenceMetaDataDefaults
|
||||||
meta.getDescribedType(), "set" +
|
meta.getDescribedType(), "set" +
|
||||||
StringUtils.capitalize(name), new Class[] {
|
StringUtils.capitalize(name), new Class[] {
|
||||||
((Method) member).getReturnType() }));
|
((Method) member).getReturnType() }));
|
||||||
if (setter == null) {
|
if (setter == null && !isAnnotatedTransient(member)) {
|
||||||
logNoSetter(meta, name, null);
|
logNoSetter(meta, name, null);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// e.g., NoSuchMethodException
|
// e.g., NoSuchMethodException
|
||||||
logNoSetter(meta, name, e);
|
if (!isAnnotatedTransient(member))
|
||||||
|
logNoSetter(meta, name, e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -313,6 +314,11 @@ public class PersistenceMetaDataDefaults
|
||||||
return true;
|
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) {
|
private void logNoSetter(ClassMetaData meta, String name, Exception e) {
|
||||||
Log log = meta.getRepository().getConfiguration()
|
Log log = meta.getRepository().getConfiguration()
|
||||||
.getLog(OpenJPAConfiguration.LOG_METADATA);
|
.getLog(OpenJPAConfiguration.LOG_METADATA);
|
||||||
|
|
Loading…
Reference in New Issue