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/19 22:06:41 UTC
[06/12] isis git commit: ISIS-1276: fixes algorithm for lookup of
datastore id's, at least
ISIS-1276: 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/19862e44
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/19862e44
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/19862e44
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: 19862e44679e562efe5f313f816c88c5a7b4786c
Parents: 2f4b8f1
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: Tue Sep 19 23:05:16 2017 +0100
----------------------------------------------------------------------
.../persistence/spi/JdoObjectIdSerializer.java | 45 ++++++--------------
1 file changed, 13 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/19862e44/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;
}
}