More informative message when multiple fields used wrongly as primary key

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@722060 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2008-12-01 12:42:00 +00:00
parent 3f47c13c68
commit c28c7830d5
2 changed files with 5 additions and 4 deletions

View File

@ -1861,7 +1861,8 @@ public class ClassMetaData
throw new MetaDataException(_loc.get("unsupported-id-type",
_type, pks[0].getName(),
pks[0].getDeclaredType().getName()));
throw new MetaDataException(_loc.get("no-id-class", _type));
throw new MetaDataException(_loc.get("no-id-class", _type,
Arrays.asList(toNames(pks))));
}
if (_objectId == null)
return;

View File

@ -164,9 +164,9 @@ id-types: Type "{0}" does not declare the same identity-type as its persistent \
superclass.
id-classes: Type "{0}" declares an id class "{1}" that does not match or \
extend its persistent superclass "{2}" identity class "{3}".
no-id-class: Type "{0}" with application identity and no superclass does \
not declare an id class. This type is not eligible for builtin \
identity, so it must declare an id class.
no-id-class: Entity "{0}" is using composite primary key comprising more than \
one fields "{1}", but no primary key class has been defined in this class \
or any of its persistent super classes.
bad-pk: Field "{0}" cannot be a primary key. Primary key fields can only be \
declared in base persistent classes that also declare their identity-type \
to be "application".