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/10/01 13:08:39 UTC
[isis] 06/12: ISIS-1276: fixes algorithm for lookup of datastore
id's, at least
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch dev/2.0.0/ISIS-1276-dn-5-1
in repository https://gitbox.apache.org/repos/asf/isis.git
commit be40ecfa06ac31d15cca66699f031b0a55f88b75
Author: Dan Haywood <da...@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 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;
}
}
--
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.