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
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue