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

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 6a3b8cb  ISIS-1889 fixes algorithm for lookup of datastore id's, at 
least
6a3b8cb is described below

commit 6a3b8cb804e212f130749ca3aff4036c957726bc
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri Mar 2 18:25:05 2018 +0100

    ISIS-1889 fixes algorithm for lookup of datastore id's, at least
    
    as originally committed to M2 by Dan
    ISIS-1276: fixes algorithm for lookup of datastore id's, at least
---
 .../persistence/spi/JdoObjectIdSerializer.java     | 44 +++++++---------------
 1 file changed, 13 insertions(+), 31 deletions(-)

diff --git 
a/core/plugins/jdo-datanucleus-5/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
 
b/core/plugins/jdo-datanucleus-5/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
index fcfb0d8..b4e709f 100644
--- 
a/core/plugins/jdo-datanucleus-5/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
+++ 
b/core/plugins/jdo-datanucleus-5/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
@@ -93,38 +93,17 @@ 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;
-                }
+            if( keyValue instanceof String ||
+                    keyValue instanceof Long ||
+                    keyValue instanceof BigDecimal || // 1.8.0 did not support 
BigDecimal
+                    keyValue instanceof BigInteger ||
+                    keyValue instanceof Integer) {
 
-            } 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;
-                }
+                // no separator
+                return "" + keyValue;
             }
+            
         }
 
         // the JDO spec (5.4.3) requires that OIDs are serializable toString 
and 
@@ -204,8 +183,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