You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/09/18 21:56:11 UTC

[6/6] isis git commit: ISIS-1726: fixes algorithm for lookup of datastore id's, at least

ISIS-1726: fixes algorithm for lookup of datastore id's, at least


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/987a479d
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/987a479d
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/987a479d

Branch: refs/heads/ISIS-1726-dn-5-1
Commit: 987a479dbb74567bf8351ff4069d8b4f51079d35
Parents: e126b93
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Sep 18 22:55:49 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Mon Sep 18 22:55:49 2017 +0100

----------------------------------------------------------------------
 .../persistence/spi/JdoObjectIdSerializer.java  | 45 ++++++--------------
 1 file changed, 13 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/987a479d/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
----------------------------------------------------------------------
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 48d4da9..ebb4d40 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
@@ -90,37 +90,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;
             }
         }
 
@@ -201,7 +178,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;
 
         }
     }