This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0-M2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit b193a807d5924fde7a762b8de7b3b8191973674b
Author: Dan Haywood <d...@haywood-associates.co.uk>
AuthorDate: Mon Sep 18 22:55:49 2017 +0100

    ISIS-1276: fixes algorithm for lookup of datastore id's, at least
---
 .../persistence/spi/JdoObjectIdSerializer.java     | 45 +++++++---------------
 1 file changed, 13 insertions(+), 32 deletions(-)

diff --git 
a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
 
b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
index fcfb0d8..e185908 100644
--- 
a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
+++ 
b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
@@ -93,37 +93,14 @@ public final class JdoObjectIdSerializer {
             final DatastoreId dnOid = (DatastoreId) jdoOid;
             final Object keyValue = dnOid.getKeyAsObject();
 
-            if(false) {
-
-                //
-                // 1.8.0 original handling, appending a prefix "L_" or whatever
-                //
-                // if required by user community, we could add a property in 
isis.properties to enable if requested.
-                //
-                if(keyValue instanceof String) {
-                    return "S" + SEPARATOR + keyValue;
-                }
-                if(keyValue instanceof Long) {
-                    return "L" + SEPARATOR + keyValue;
-                }
-
-                if(keyValue instanceof BigInteger) {
-                    return "B" + SEPARATOR + keyValue;
-                }
-                if(keyValue instanceof Integer) {
-                    return "I" + SEPARATOR + keyValue;
-                }
-
-            } else {
-                if( keyValue instanceof String ||
-                        keyValue instanceof Long ||
-                        keyValue instanceof BigDecimal || // 1.8.0 did not 
support BigDecimal
-                        keyValue instanceof BigInteger ||
-                        keyValue instanceof Integer) {
-
-                    // no separator
-                    return "" + keyValue;
-                }
+            if( keyValue instanceof String ||
+                    keyValue instanceof Long ||
+                    keyValue instanceof BigDecimal || // 1.8.0 did not support 
BigDecimal
+                    keyValue instanceof BigInteger ||
+                    keyValue instanceof Integer) {
+
+                // no separator
+                return "" + keyValue;
             }
         }
 
@@ -204,7 +181,11 @@ public final class JdoObjectIdSerializer {
             // @javax.jdo.annotations.PersistenceCapable(identityType = 
IdentityType.DATASTORE)
             // for one of the common types (prettier handling)
 
-            return idStr + "[OID]" + spec.getFullIdentifier();
+            // in DN 4.1, we did this...
+            // return idStr + "[OID]" + spec.getFullIdentifier();
+
+            // in DN 5.1, we simply do this...
+            return idStr;
 
         }
     }

-- 
To stop receiving notification emails like this one, please contact
ahu...@apache.org.

Reply via email to