Do not repeat class name in stringfied object id

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@923938 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2010-03-16 18:58:37 +00:00
parent c618b4692d
commit 8dc74c1e59
1 changed files with 7 additions and 1 deletions

View File

@ -91,7 +91,13 @@ public class Exceptions {
if (oid != null) {
if (oid instanceof Id)
return oid.toString();
return ob.getClass().getName() + "-" + oid.toString();
String oidString = oid.toString();
// some oids stringify their class names. Some do not.
if (oidString.indexOf(ob.getClass().getName()) == -1) {
return ob.getClass().getName() + "-" + oidString;
} else {
return oidString;
}
}
if (ImplHelper.isManagedType(null, ob.getClass())) {