OPENJPA-2083 Unmapped fields silently treated as transient. Patch provided by Jacob Nowosatka.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1226910 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald Woods 2012-01-03 18:46:08 +00:00
parent da004e608e
commit 6369c744bd
2 changed files with 12 additions and 5 deletions

View File

@ -628,10 +628,15 @@ public class PersistenceMetaDataDefaults
}
PersistenceStrategy strat = getPersistenceStrategy(null, member, ignoreTransient);
if (strat == null || strat == PersistenceStrategy.TRANSIENT)
if (strat == null) {
warn(meta, _loc.get("no-pers-strat", name));
return false;
return true;
}
} else if (strat == PersistenceStrategy.TRANSIENT) {
return false;
} else {
return true;
}
}
private boolean isAnnotatedTransient(Member member) {
return member instanceof AnnotatedElement

View File

@ -63,8 +63,10 @@ unsupported: OpenJPA does not yet support "{1}" as used in "{0}".
bad-meta-anno: The type of field "{0}" isn''t supported by declared \
persistence strategy "{1}". Please choose a different strategy.
no-pers-strat: Fields "{0}" are not a default persistent type, and do not \
have any annotations indicating their persistence strategy. If you do \
not want these fields to be persisted, annotate them with @Transient.
have any annotations indicating their persistence strategy. They will \
be treated as non-persistent. If you intended for these fields to be \
persistent, be sure to annotate them appropriately. Otherwise annotate \
them with @Transient.
generator-bad-strategy: "{0}" declares generator name "{1}", but uses the AUTO \
generation type. The only valid generator names under AUTO are "uuid-hex" \
and "uuid-string".