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 2018/01/05 10:24:28 UTC

[isis] branch dev/2.0.0-M2 created (now 060fa6e)

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

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


      at 060fa6e  Merge branch 'dev/2.0.0/ISIS-1276-dn-5-1' into dev/2.0.0-M2

This branch includes the following new commits:

     new 12b2b35  ISIS-1276: updates references for datanucleus.
     new a983f01  ISIS-1276: updates core to compile under JDK 1.8 only
     new d0945e2  ISIS-1276: updates applib, replaces references of TypesafeQuery to be instead JDOQLTypedQuery
     new e1c9fa9  ISIS-1276: fixes compile issues in metamodel and runtime
     new 994d824  ISIS-1276: fixes algorithm for lookup of datastore id's, at least
     new 4b2b08a  ISIS-1723: removes jdo applib's Auditable interface and @Auditable annotation
     new 9c02fe5  ISIS-1724: removes the deprecated IsisJdoSupport in the jdo applib
     new c17a16d  ISIS-1725: requires that an AppManifest is supplied (used to obtain list of entities).
     new 0dd3173  ISIS-1727: uses lambda in IsisSessionFactoryBuilder
     new 40410e7  ISIS-1726: generalizes the logic that searches for @PersistenceCapable entities, to also take into account meta-annotations.
     new 92cdd2e  ISIS-1728: uses typesafe queries for helloworld
     new 060fa6e  Merge branch 'dev/2.0.0/ISIS-1276-dn-5-1' into dev/2.0.0-M2

The 12 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@isis.apache.org" <co...@isis.apache.org>'].

[isis] 09/12: ISIS-1727: uses lambda in IsisSessionFactoryBuilder

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0dd31737638c032f64e141c1d31d2599ac92301f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 22:56:54 2017 +0100

    ISIS-1727: uses lambda in IsisSessionFactoryBuilder
---
 .../system/session/IsisSessionFactoryBuilder.java  | 25 ++++++++++------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
index 1ddcaf7..b9d4e21 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
@@ -209,22 +209,19 @@ public class IsisSessionFactoryBuilder {
 
 
             isisSessionFactory.doInSession(
-                    new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                specificationLoader.validateAndAssert();
-
-                            } catch (final MetaModelInvalidException ex) {
-                                // no need to use a higher level, such as error(...); the calling code will expose any metamodel
-                                // validation errors in their own particular way.
-                                if(LOG.isDebugEnabled()) {
-                                    LOG.debug("Meta model invalid", ex);
-                                }
-                                IsisContext.setMetaModelInvalidException(ex);
+                    () -> {
+                        try {
+                            specificationLoader.validateAndAssert();
+
+                        } catch (final MetaModelInvalidException ex) {
+                            // no need to use a higher level, such as error(...); the calling code will expose any metamodel
+                            // validation errors in their own particular way.
+                            if(LOG.isDebugEnabled()) {
+                                LOG.debug("Meta model invalid", ex);
                             }
-
+                            IsisContext.setMetaModelInvalidException(ex);
                         }
+
                     }
             );
 

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 04/12: ISIS-1276: fixes compile issues in metamodel and runtime

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e1c9fa9e453b4ec094c08ef0be95751408df7c4c
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Sep 18 22:29:13 2017 +0100

    ISIS-1276: fixes compile issues in metamodel and runtime
---
 .../value/vsp/ValueSemanticsProviderUtil.java      |  2 --
 ...ionParameterAbstractTest_getId_and_getName.java |  8 ++++---
 .../DataNucleusApplicationComponents.java          |  2 +-
 .../persistence/PersistenceSessionFactory.java     |  2 +-
 .../CreateSchemaObjectFromClassMetadata.java       |  3 ++-
 .../service/support/IsisJdoSupportImpl.java        | 27 +++++++++-------------
 6 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/vsp/ValueSemanticsProviderUtil.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/vsp/ValueSemanticsProviderUtil.java
index 03658a5..b34d5fe 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/vsp/ValueSemanticsProviderUtil.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/vsp/ValueSemanticsProviderUtil.java
@@ -24,7 +24,6 @@ import com.google.common.base.Strings;
 import org.apache.isis.applib.adapters.ValueSemanticsProvider;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.lang.ClassUtil;
-import org.apache.isis.core.commons.lang.StringExtensions;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 
 public final class ValueSemanticsProviderUtil {
@@ -46,7 +45,6 @@ public final class ValueSemanticsProviderUtil {
         @SuppressWarnings("rawtypes")
         final Class clazz = candidateClass != null ? ClassUtil.implementingClassOrNull(candidateClass.getName(), ValueSemanticsProvider.class, FacetHolder.class) : null;
         return clazz != null ? clazz : (Class)ClassUtil.implementingClassOrNull(classCandidateName, ValueSemanticsProvider.class, FacetHolder.class);
-
     }
 
 }
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
index 1f3fcc3..3e1eb76 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
@@ -19,6 +19,8 @@
 
 package org.apache.isis.core.metamodel.specloader.specimpl;
 
+import javax.ws.rs.HEAD;
+
 import com.google.common.base.Predicate;
 import com.google.common.collect.Lists;
 
@@ -164,7 +166,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
                 one(actionParamPeer).getFacet(NamedFacet.class);
                 will(returnValue(null));
 
-                one(parentAction).getParameters((Predicate<ObjectActionParameter>) with(Expectations.<Predicate>anything()));
+                one(parentAction).getParameters(with(Expectations.<Predicate<ObjectActionParameter>>anything()));
                 will(returnValue(Lists.newArrayList(objectActionParameter)));
             }
         });
@@ -183,7 +185,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
                 one(actionParamPeer).getFacet(NamedFacet.class);
                 will(returnValue(null));
 
-                one(parentAction).getParameters(with(Expectations.<Predicate>anything()));
+                one(parentAction).getParameters(with(Expectations.<Predicate<ObjectActionParameter>>anything()));
                 will(returnValue(Lists.newArrayList(stubObjectActionParameterString, objectActionParameter, stubObjectActionParameterString2)));
             }
         });
@@ -202,7 +204,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
                 one(actionParamPeer).getFacet(NamedFacet.class);
                 will(returnValue(null));
 
-                one(parentAction).getParameters(with(Expectations.<Predicate>anything()));
+                one(parentAction).getParameters(with(Expectations.<Predicate<ObjectActionParameter>>anything()));
                 will(returnValue(Lists.newArrayList(stubObjectActionParameterString, objectActionParameter, stubObjectActionParameterString2)));
             }
         });
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
index 52ac35b..a68ce06 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
@@ -144,7 +144,7 @@ public class DataNucleusApplicationComponents implements ApplicationScopedCompon
                 // (if the configured StoreMgr supports it, and if requested in isis.properties)
                 //
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_ALL, "false"); // turn off, cos want to do the schema object ourselves...
-                datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_SCHEMA, "false");
+                datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_DATABASE, "false");
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_TABLES, "true"); // but have DN do everything else...
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_COLUMNS, "true");
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_CONSTRAINTS, "true");
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
index 4504548..8a89c8a 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
@@ -112,7 +112,7 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
         putIfNotPresent(props, "javax.jdo.PersistenceManagerFactoryClass", JDOPersistenceManagerFactory.class.getName());
 
         // previously we defaulted this property to "true", but that could cause the target database to be modified
-        putIfNotPresent(props, PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_SCHEMA, Boolean.FALSE.toString());
+        putIfNotPresent(props, PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_DATABASE, Boolean.FALSE.toString());
 
         putIfNotPresent(props, PropertyNames.PROPERTY_SCHEMA_VALIDATE_ALL, Boolean.TRUE.toString());
         putIfNotPresent(props, PropertyNames.PROPERTY_CACHE_L2_TYPE, "none");
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
index 990e52d..d2ee742 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
@@ -31,10 +31,11 @@ import org.datanucleus.ClassLoaderResolver;
 import org.datanucleus.enhancer.EnhancementNucleusContextImpl;
 import org.datanucleus.metadata.AbstractClassMetaData;
 import org.datanucleus.metadata.MetaDataListener;
-import org.datanucleus.store.encryption.ConnectionEncryptionProvider;
+import org.datanucleus.store.ConnectionEncryptionProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * Implementation note: the methods in this class are <tt>protected</tt> to allow for easy subclassing.
  */
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
index a9a2ac5..e5171c9 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
@@ -29,16 +29,14 @@ import java.util.Map;
 import java.util.concurrent.Callable;
 
 import javax.jdo.Extent;
+import javax.jdo.JDOQLTypedQuery;
 import javax.jdo.PersistenceManager;
 import javax.jdo.datastore.JDOConnection;
+import javax.jdo.query.BooleanExpression;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
-import org.datanucleus.api.jdo.JDOPersistenceManager;
-import org.datanucleus.query.typesafe.BooleanExpression;
-import org.datanucleus.query.typesafe.TypesafeQuery;
-
 import org.apache.isis.applib.FatalException;
 import org.apache.isis.applib.annotation.DomainService;
 import org.apache.isis.applib.annotation.NatureOfService;
@@ -158,12 +156,9 @@ public class IsisJdoSupportImpl implements IsisJdoSupport {
             
             // temporarily disable concurrency checking while this method is performed
             try {
-                ConcurrencyChecking.executeWithConcurrencyCheckingDisabled(new Callable<Void>() {
-                    @Override
-                    public Void call() {
-                        getJdoPersistenceManager().deletePersistentAll(instances);
-                        return null;
-                    }
+                ConcurrencyChecking.executeWithConcurrencyCheckingDisabled((Callable<Void>) () -> {
+                    getJdoPersistenceManager().deletePersistentAll(instances);
+                    return null;
                 });
             } catch (final Exception ex) {
                 throw new FatalException(ex);
@@ -176,31 +171,31 @@ public class IsisJdoSupportImpl implements IsisJdoSupport {
     @Programmatic
     @Override
     public <T> List<T> executeQuery(final Class<T> cls, final BooleanExpression expression) {
-        final TypesafeQuery<T> query = newTypesafeQuery(cls).filter(expression);
+        final JDOQLTypedQuery<T> query = newTypesafeQuery(cls).filter(expression);
         return executeListAndClose(query);
     }
 
     @Programmatic
     @Override
     public <T> T executeQueryUnique(final Class<T> cls, final BooleanExpression expression) {
-        final TypesafeQuery<T> query = newTypesafeQuery(cls).filter(expression);
+        final JDOQLTypedQuery<T> query = newTypesafeQuery(cls).filter(expression);
         return executeUniqueAndClose(query);
     }
 
     @Programmatic
     @Override
-    public <T> TypesafeQuery<T> newTypesafeQuery(Class<T> cls) {
-        return ((JDOPersistenceManager)getJdoPersistenceManager()).newTypesafeQuery(cls);
+    public <T> JDOQLTypedQuery<T> newTypesafeQuery(Class<T> cls) {
+        return getJdoPersistenceManager().newJDOQLTypedQuery(cls);
     }
 
-    private static <T> List<T> executeListAndClose(final TypesafeQuery<T> query) {
+    private static <T> List<T> executeListAndClose(final JDOQLTypedQuery<T> query) {
         final List<T> elements = query.executeList();
         final List<T> list = Lists.newArrayList(elements);
         query.closeAll();
         return list;
     }
 
-    private static <T> T executeUniqueAndClose(final TypesafeQuery<T> query) {
+    private static <T> T executeUniqueAndClose(final JDOQLTypedQuery<T> query) {
         final T result = query.executeUnique();
         query.closeAll();
         return result;

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 06/12: ISIS-1723: removes jdo applib's Auditable interface and @Auditable annotation

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4b2b08a47c3d3304994aa8951e430bb201def6be
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 22:43:59 2017 +0100

    ISIS-1723: removes jdo applib's Auditable interface and @Auditable annotation
---
 .../system/persistence/PersistenceSessionFactoryMetamodelRefiner.java    | 1 -
 1 file changed, 1 deletion(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactoryMetamodelRefiner.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactoryMetamodelRefiner.java
index c294447..7534598 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactoryMetamodelRefiner.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactoryMetamodelRefiner.java
@@ -55,7 +55,6 @@ public class PersistenceSessionFactoryMetamodelRefiner implements MetaModelRefin
         // and also MandatoryFacetOnPropertyMandatoryAnnotationFactory
         // and also PropertyAnnotationFactory
         programmingModel.addFactory(new MandatoryFromJdoColumnAnnotationFacetFactory());
-
     }
 
     @Override

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 01/12: ISIS-1276: updates references for datanucleus.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 12b2b35a80d57df3f52eacc08b315b087b4a355f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Sep 18 22:13:20 2017 +0100

    ISIS-1276: updates references for datanucleus.
    
    Also updated org.incode:incode-build to 3-SNAPSHOT, and java-mavenmixin-datanucleus to 0.0.5-SNAPSHOT
---
 core/applib/pom.xml                    | 39 ++--------------------------------
 core/pom.xml                           | 19 ++++++++---------
 core/unittestsupport/pom.xml           |  5 ++---
 example/application/helloworld/pom.xml |  4 ++--
 example/application/simpleapp/pom.xml  |  2 +-
 5 files changed, 16 insertions(+), 53 deletions(-)

diff --git a/core/applib/pom.xml b/core/applib/pom.xml
index cea4c42..be3411c 100644
--- a/core/applib/pom.xml
+++ b/core/applib/pom.xml
@@ -51,41 +51,6 @@
                 </excludes>
             </resource>
         </resources>
-        <pluginManagement>
-            <plugins>
-                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
-                <plugin>
-                    <groupId>org.eclipse.m2e</groupId>
-                    <artifactId>lifecycle-mapping</artifactId>
-                    <version>1.0.0</version>
-                    <configuration>
-                        <lifecycleMappingMetadata>
-                            <pluginExecutions>
-                                <pluginExecution>
-                                    <pluginExecutionFilter>
-                                        <groupId>
-                                            org.datanucleus
-                                        </groupId>
-                                        <artifactId>
-                                            datanucleus-maven-plugin
-                                        </artifactId>
-                                        <versionRange>
-                                            [4.0.0-release,)
-                                        </versionRange>
-                                        <goals>
-                                            <goal>enhance</goal>
-                                        </goals>
-                                    </pluginExecutionFilter>
-                                    <action>
-                                        <ignore />
-                                    </action>
-                                </pluginExecution>
-                            </pluginExecutions>
-                        </lifecycleMappingMetadata>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </pluginManagement>
     </build>
 
     <dependencies>
@@ -128,8 +93,8 @@
 
         <!-- DataNucleus' standard JDO support -->
         <dependency>
-            <groupId>javax.jdo</groupId>
-            <artifactId>jdo-api</artifactId>
+            <groupId>org.datanucleus</groupId>
+            <artifactId>javax.jdo</artifactId>
         </dependency>
 
         <!-- DataNucleus' (proprietary) type-safe query support-->
diff --git a/core/pom.xml b/core/pom.xml
index 18a1731a..bb311e5 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -84,14 +84,13 @@
 [6] https://github.com/moment/moment/blob/develop/LICENSE</license.additional-notes>
 
         <!-- Datanucleus Objectstore -->
-        <jdo-api.version>3.1</jdo-api.version>
+        <jdo-api.version>3.2.0-m7</jdo-api.version>
 
-        <datanucleus-core.version>4.1.7</datanucleus-core.version>
-        <datanucleus-api-jdo.version>4.1.1</datanucleus-api-jdo.version>
-        <datanucleus-jdo-query.version>4.0.5</datanucleus-jdo-query.version>
-        <datanucleus-rdbms.version>4.1.9</datanucleus-rdbms.version>
-
-        <datanucleus-jodatime.version>4.1.0-release</datanucleus-jodatime.version>
+        <datanucleus-core.version>5.1.2</datanucleus-core.version>
+        <datanucleus-api-jdo.version>5.1.2</datanucleus-api-jdo.version>
+        <datanucleus-jdo-query.version>5.0.2</datanucleus-jdo-query.version>
+        <datanucleus-rdbms.version>5.1.2</datanucleus-rdbms.version>
+        <datanucleus-jodatime.version>5.1.0-release</datanucleus-jodatime.version>
 	<!--
 	    ISIS-1288: seen integration tests to fail;
 	    domain object date holding 1-Aug-2015 after xactn retrieved as 31-Jul-2015
@@ -100,7 +99,7 @@
 
         <datanucleus-jodatime.version>4.1.1</datanucleus-jodatime.version>
 	-->
-        <datanucleus-maven-plugin.version>4.0.2</datanucleus-maven-plugin.version>
+        <datanucleus-maven-plugin.version>5.0.2</datanucleus-maven-plugin.version>
 
         <shiro.version>1.2.6</shiro.version>
 
@@ -1955,8 +1954,8 @@ ${license.additional-notes}
 
             <!-- DataNucleus -->
             <dependency>
-                <groupId>javax.jdo</groupId>
-                <artifactId>jdo-api</artifactId>
+                <groupId>org.datanucleus</groupId>
+                <artifactId>javax.jdo</artifactId>
                 <version>${jdo-api.version}</version>
             </dependency>
             <dependency>
diff --git a/core/unittestsupport/pom.xml b/core/unittestsupport/pom.xml
index 8d09993..02d8027 100644
--- a/core/unittestsupport/pom.xml
+++ b/core/unittestsupport/pom.xml
@@ -56,9 +56,8 @@
            </dependency>
 
             <dependency>
-                <groupId>javax.jdo</groupId>
-                <artifactId>jdo-api</artifactId>
-                <version>${jdo-api.version}</version>
+                <groupId>org.datanucleus</groupId>
+                <artifactId>javax.jdo</artifactId>
                 <optional>true</optional>
             </dependency>
 
diff --git a/example/application/helloworld/pom.xml b/example/application/helloworld/pom.xml
index e9fd6bb..aee7956 100644
--- a/example/application/helloworld/pom.xml
+++ b/example/application/helloworld/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.incode</groupId>
         <artifactId>incode-build</artifactId>
-        <version>2</version>
+        <version>3-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.isis.example.application</groupId>
@@ -40,7 +40,7 @@
 
         <compiler-plugin.source>1.8</compiler-plugin.source>
         <compiler-plugin.target>1.8</compiler-plugin.target>
-        <compiler-plugin.compilerArgument></compiler-plugin.compilerArgument>
+        <compiler-plugin.compilerArgument>-parameters</compiler-plugin.compilerArgument>
 
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
diff --git a/example/application/simpleapp/pom.xml b/example/application/simpleapp/pom.xml
index 4dd98c6..eb423d2 100644
--- a/example/application/simpleapp/pom.xml
+++ b/example/application/simpleapp/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.incode</groupId>
         <artifactId>incode-build</artifactId>
-        <version>2</version>
+        <version>3-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.isis.example.application</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 08/12: ISIS-1725: requires that an AppManifest is supplied (used to obtain list of entities).

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c17a16d0773d1e3ff0a074dd0726a5c90fc239fc
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 22:55:48 2017 +0100

    ISIS-1725: requires that an AppManifest is supplied (used to obtain list of entities).
---
 .../persistence/PersistenceSessionFactory.java     |  2 +-
 .../objectstore/jdo/service/RegisterEntities.java  | 96 ++--------------------
 2 files changed, 9 insertions(+), 89 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
index 8a89c8a..4be046c 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
@@ -93,7 +93,7 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
             final Map<String, String> datanucleusProps = dataNucleusConfig.asMap();
             addDataNucleusPropertiesIfRequired(datanucleusProps);
 
-            final RegisterEntities registerEntities = new RegisterEntities(configuration.asMap(), specificationLoader);
+            final RegisterEntities registerEntities = new RegisterEntities(specificationLoader);
             final Set<String> classesToBePersisted = registerEntities.getEntityTypes();
 
             applicationComponents = new DataNucleusApplicationComponents(jdoObjectstoreConfig, specificationLoader,
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
index 538b5b1..a83b115 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
@@ -18,23 +18,13 @@
  */
 package org.apache.isis.objectstore.jdo.service;
 
-import java.util.Collections;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
-import javax.jdo.annotations.PersistenceCapable;
-
-import com.google.common.base.Function;
 import com.google.common.base.Joiner;
-import com.google.common.base.Predicate;
-import com.google.common.base.Splitter;
-import com.google.common.base.Strings;
-import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
-import org.reflections.Reflections;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,7 +35,11 @@ public class RegisterEntities {
 
     @SuppressWarnings("unused")
     private final static Logger LOG = LoggerFactory.getLogger(RegisterEntities.class);
-    
+
+    /**
+     * @deprecated - no longer used; instead an AppManifest must be specified.
+     */
+    @Deprecated
     public final static String PACKAGE_PREFIX_KEY = "isis.persistor.datanucleus.RegisterEntities.packagePrefix";
 
     // //////////////////////////////////////
@@ -60,13 +54,13 @@ public class RegisterEntities {
     }
     //endregion
 
-    public RegisterEntities(final Map<String, String> configuration, final SpecificationLoader specificationLoader) {
+    public RegisterEntities(final SpecificationLoader specificationLoader) {
         this.specificationLoader = specificationLoader;
 
         Set<Class<?>> persistenceCapableTypes = AppManifest.Registry.instance().getPersistenceCapableTypes();
 
         if(persistenceCapableTypes == null) {
-            persistenceCapableTypes = searchForPersistenceCapables(configuration);
+            throw new IllegalStateException("AppManifest is required");
         }
 
         final List<String> classNamesNotEnhanced = Lists.newArrayList();
@@ -86,88 +80,14 @@ public class RegisterEntities {
         }
     }
 
-    /**
-     * only called if no appManifest
-     */
-    Set<Class<?>> searchForPersistenceCapables(final Map<String, String> configuration) {
-
-        final String packagePrefixes = lookupPackagePrefixes(configuration);
-
-        final Set<Class<?>> persistenceCapableTypes = Sets.newLinkedHashSet();
-        final List<String> domPackages = parseDomPackages(packagePrefixes);
-        for (final String packageName : domPackages) {
-            Reflections reflections = new Reflections(packageName);
-            final Set<Class<?>> entityTypesInPackage =
-                    reflections.getTypesAnnotatedWith(PersistenceCapable.class);
-
-            if(!entitiesIn(entityTypesInPackage)) {
-                throw new IllegalArgumentException(String.format(
-                        "Bad configuration.\n\nCould not locate any @PersistenceCapable entities in package '%s'\n" +
-                                "Check value of '%s' key in WEB-INF/*.properties\n",
-                        packageName,
-                        PACKAGE_PREFIX_KEY));
-            }
-            persistenceCapableTypes.addAll(entityTypesInPackage);
-        }
-        return persistenceCapableTypes;
-    }
-
-    private String lookupPackagePrefixes(final Map<String, String> configuration) {
-        final String packagePrefixes = configuration.get(PACKAGE_PREFIX_KEY);
-        if(Strings.isNullOrEmpty(packagePrefixes)) {
-            throw new IllegalArgumentException(String.format(
-                    "Could not locate '%s' key in property files - aborting",
-                    PACKAGE_PREFIX_KEY));
-        }
-        return packagePrefixes;
-    }
-
-    private static List<String> parseDomPackages(String packagePrefixes) {
-        return Collections.unmodifiableList(Lists.newArrayList(Iterables.transform(Splitter.on(",").split(packagePrefixes), trim())));
-    }
-
     private static boolean ignore(final Class<?> entityType) {
-        try {
-            if(entityType.isAnonymousClass() || entityType.isLocalClass() || entityType.isMemberClass()) {
-                return true;
-            }
-            final PersistenceCapable persistenceCapable = entityType.getAnnotation(PersistenceCapable.class);
-            return persistenceCapable == null; // ignore if doesn't have @PersistenceCapable
-        } catch (NoClassDefFoundError ex) {
-            return true;
-        }
-    }
-
-    private static Function<String,String> trim() {
-        return new Function<String,String>(){
-            @Override
-            public String apply(String input) {
-                return input.trim();
-            }
-        };
-    }
-
-    private static boolean entitiesIn(Set<Class<?>> entityTypes) {
-        return Iterables.filter(entityTypes, notNullClass()).iterator().hasNext();
+        return entityType.isAnonymousClass() || entityType.isLocalClass() || entityType.isMemberClass() || entityType.isAnnotation();
     }
 
-    /**
-     * {@link Reflections} seems to return a set with 1 null element if none can be found, so we ignore these.
-     */
-    private static <T> Predicate<T> notNullClass() {
-        return new Predicate<T>() {
-            @Override
-            public boolean apply(T input) {
-                return input != null;
-            }
-        };
-    }
 
-    // //////////////////////////////////////
 
     SpecificationLoader getSpecificationLoader() {
         return specificationLoader;
     }
 
-
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 12/12: Merge branch 'dev/2.0.0/ISIS-1276-dn-5-1' into dev/2.0.0-M2

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 060fa6ea4c35203f83cee591701dd1eb21b9f73a
Merge: 6a9e1cd 92cdd2e
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 5 10:24:12 2018 +0000

    Merge branch 'dev/2.0.0/ISIS-1276-dn-5-1' into dev/2.0.0-M2

 core/applib/pom.xml                                | 39 +--------
 .../applib/services/jdosupport/IsisJdoSupport.java |  7 +-
 .../value/vsp/ValueSemanticsProviderUtil.java      |  2 -
 ...ionParameterAbstractTest_getId_and_getName.java |  8 +-
 core/pom.xml                                       | 21 +++--
 .../DataNucleusApplicationComponents.java          |  2 +-
 .../persistence/PersistenceSessionFactory.java     |  4 +-
 .../PersistenceSessionFactoryMetamodelRefiner.java |  1 -
 .../system/session/IsisSessionFactoryBuilder.java  | 25 +++---
 .../IsisComponentProvider.java                     | 34 ++++++--
 .../CreateSchemaObjectFromClassMetadata.java       |  3 +-
 .../persistence/spi/JdoObjectIdSerializer.java     | 45 +++-------
 .../service/support/IsisJdoSupportImpl.java        | 29 +++----
 .../objectstore/jdo/service/RegisterEntities.java  | 96 ++--------------------
 core/unittestsupport/pom.xml                       |  5 +-
 example/application/helloworld/pom.xml             |  4 +-
 .../java/domainapp/dom/impl/HelloWorldObject.java  |  6 +-
 .../java/domainapp/dom/impl/HelloWorldObjects.java |  9 +-
 .../modules/simple/dom/impl/SimpleObjects.java     |  7 +-
 example/application/simpleapp/pom.xml              |  2 +-
 20 files changed, 114 insertions(+), 235 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 07/12: ISIS-1724: removes the deprecated IsisJdoSupport in the jdo applib

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9c02fe53380224f02137d117cfb6f8c45a577da6
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 22:50:00 2017 +0100

    ISIS-1724: removes the deprecated IsisJdoSupport in the jdo applib
---
 .../objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
index e5171c9..6e2ef41 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
@@ -62,7 +62,7 @@ import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
         nature = NatureOfService.DOMAIN,
         menuOrder = "" + Integer.MAX_VALUE
 )
-public class IsisJdoSupportImpl implements IsisJdoSupport {
+public class IsisJdoSupportImpl implements org.apache.isis.applib.services.jdosupport.IsisJdoSupport {
     
     @Programmatic
     @Override

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 02/12: ISIS-1276: updates core to compile under JDK 1.8 only

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a983f01f6f934fa0cfbed386f193b1371420afae
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Sep 18 22:16:56 2017 +0100

    ISIS-1276: updates core to compile under JDK 1.8 only
---
 core/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/pom.xml b/core/pom.xml
index bb311e5..9fe4391 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -2086,7 +2086,7 @@ ${license.additional-notes}
                         <configuration>
                             <toolchains>
                                 <jdk>
-                                    <version>1.7</version>
+                                    <version>1.8</version>
                                     <vendor>oracle</vendor>
                                 </jdk>
                             </toolchains>

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 03/12: ISIS-1276: updates applib, replaces references of TypesafeQuery to be instead JDOQLTypedQuery

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d0945e22a68c0deaefb54601dd9d5e3c2d1182d0
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Sep 18 22:17:54 2017 +0100

    ISIS-1276: updates applib, replaces references of TypesafeQuery to be instead JDOQLTypedQuery
---
 .../org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java b/core/applib/src/main/java/org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java
index 4ca5c10..75a4e0f 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java
@@ -23,10 +23,9 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
+import javax.jdo.JDOQLTypedQuery;
 import javax.jdo.PersistenceManager;
-
-import org.datanucleus.query.typesafe.BooleanExpression;
-import org.datanucleus.query.typesafe.TypesafeQuery;
+import javax.jdo.query.BooleanExpression;
 
 import org.apache.isis.applib.annotation.Programmatic;
 
@@ -132,5 +131,5 @@ public interface IsisJdoSupport {
      * </p>
      */
     @Programmatic
-    <T> TypesafeQuery<T> newTypesafeQuery(Class<T> cls);
+    <T> JDOQLTypedQuery<T> newTypesafeQuery(Class<T> cls);
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 10/12: ISIS-1726: generalizes the logic that searches for @PersistenceCapable entities, to also take into account meta-annotations.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 40410e77d4774396a63eb5ca3128a64fd4954f2a
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 22:59:43 2017 +0100

    ISIS-1726: generalizes the logic that searches for @PersistenceCapable entities, to also take into account meta-annotations.
---
 .../IsisComponentProvider.java                     | 35 ++++++++++++++++++----
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
index 890e831..f7ba2b1 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
@@ -19,14 +19,17 @@
 
 package org.apache.isis.core.runtime.systemusinginstallers;
 
+import java.lang.annotation.Annotation;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import javax.annotation.Nullable;
 import javax.jdo.annotations.PersistenceCapable;
+import javax.ws.rs.HEAD;
 
 import com.google.common.base.Function;
 import com.google.common.base.Joiner;
@@ -142,7 +145,7 @@ public abstract class IsisComponentProvider {
         final Reflections reflections = new Reflections(moduleAndFrameworkPackages);
 
         final Set<Class<?>> domainServiceTypes = reflections.getTypesAnnotatedWith(DomainService.class);
-        final Set<Class<?>> persistenceCapableTypes = reflections.getTypesAnnotatedWith(PersistenceCapable.class);
+        final Set<Class<?>> persistenceCapableTypes = findPersistenceCapableTypes(reflections);
         final Set<Class<? extends FixtureScript>> fixtureScriptTypes = reflections.getSubTypesOf(FixtureScript.class);
 
         final Set<Class<?>> mixinTypes = Sets.newHashSet();
@@ -150,9 +153,13 @@ public abstract class IsisComponentProvider {
 
         final Set<Class<?>> domainObjectTypes = reflections.getTypesAnnotatedWith(DomainObject.class);
         mixinTypes.addAll(
-                domainObjectTypes.stream()
-                        .filter(input -> input.getAnnotation(DomainObject.class).nature() == Nature.MIXIN)
-                        .collect(Collectors.toList())
+                domainObjectTypes.stream().filter(input -> {
+                    if (input == null) {
+                        return false;
+                    }
+                    final DomainObject annotation = input.getAnnotation(DomainObject.class);
+                    return annotation.nature() == Nature.MIXIN;
+                }).collect(Collectors.toList())
         );
 
         // add in any explicitly registered services...
@@ -192,12 +199,30 @@ public abstract class IsisComponentProvider {
     }
     static private boolean containedWithin(final List<String> packagesWithDotSuffix, final String className) {
         for (String packageWithDotSuffix : packagesWithDotSuffix) {
-            if(className.startsWith(packageWithDotSuffix)) {
+            if (className.startsWith(packageWithDotSuffix)) {
                 return true;
             }
         }
         return false;
     }
+    private Set<Class<?>> findPersistenceCapableTypes(final Reflections reflections) {
+
+        Set<Class<?>> pcSet = Sets.newLinkedHashSet();
+
+        Set<Class<?>> persistenceCapables = reflections.getTypesAnnotatedWith(PersistenceCapable.class);
+        persistenceCapables.stream()
+                .filter(x -> !x.isAnnotation())
+                .forEach(pcSet::add);
+
+        Stream<Class<? extends Annotation>> pcMetaAnnotStream =
+                (Stream)persistenceCapables.stream().filter(x -> x.isAnnotation());
+        pcMetaAnnotStream.map(metaAnnot -> reflections.getTypesAnnotatedWith(metaAnnot).stream())
+                .flatMap(x -> x)
+                .filter(x -> !x.isAnnotation())
+                .forEach(pcSet::add);
+
+        return pcSet;
+    }
 
     private void specifyServicesAndRegisteredEntitiesUsing(final AppManifest appManifest) {
         final Iterable<String> packageNames = modulePackageNamesFrom(appManifest);

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 05/12: ISIS-1276: fixes algorithm for lookup of datastore id's, at least

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 994d824e8d51cf429b3902659ef53766d7fa19f9
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>.

[isis] 11/12: ISIS-1728: uses typesafe queries for helloworld

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 92cdd2e776ae95a1c65df08ea42071e7c76cbc18
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 23:02:07 2017 +0100

    ISIS-1728: uses typesafe queries for helloworld
---
 .../runtime/systemusinginstallers/IsisComponentProvider.java     | 1 -
 .../src/main/java/domainapp/dom/impl/HelloWorldObject.java       | 6 +++---
 .../src/main/java/domainapp/dom/impl/HelloWorldObjects.java      | 9 +++++----
 .../java/domainapp/modules/simple/dom/impl/SimpleObjects.java    | 7 +++----
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
index f7ba2b1..7b05b88 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
@@ -29,7 +29,6 @@ import java.util.stream.Stream;
 
 import javax.annotation.Nullable;
 import javax.jdo.annotations.PersistenceCapable;
-import javax.ws.rs.HEAD;
 
 import com.google.common.base.Function;
 import com.google.common.base.Joiner;
diff --git a/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObject.java b/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObject.java
index 2fe8bb8..7c6b7eb 100644
--- a/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObject.java
+++ b/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObject.java
@@ -21,10 +21,8 @@ package domainapp.dom.impl;
 import javax.jdo.annotations.IdGeneratorStrategy;
 import javax.jdo.annotations.IdentityType;
 import javax.jdo.annotations.VersionStrategy;
-import javax.ws.rs.HEAD;
 
 import com.google.common.collect.ComparisonChain;
-import com.google.common.collect.Ordering;
 
 import org.apache.isis.applib.annotation.Action;
 import org.apache.isis.applib.annotation.Auditing;
@@ -45,7 +43,6 @@ import org.apache.isis.applib.services.title.TitleService;
 @javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "helloworld" )
 @javax.jdo.annotations.DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
 @javax.jdo.annotations.Version(strategy= VersionStrategy.DATE_TIME, column ="version")
-@javax.jdo.annotations.Unique(name="HelloWorldObject_name_UNQ", members = {"name"})
 @DomainObject(auditing = Auditing.ENABLED)
 @DomainObjectLayout()  // causes UI events to be triggered
 public class HelloWorldObject implements Comparable<HelloWorldObject> {
@@ -54,6 +51,8 @@ public class HelloWorldObject implements Comparable<HelloWorldObject> {
         this.name = name;
     }
 
+
+    @javax.jdo.annotations.Unique
     @javax.jdo.annotations.Column(allowsNull = "false", length = 40)
     @Property(editing = Editing.DISABLED)
     @Title(prepend = "Object: ")
@@ -61,6 +60,7 @@ public class HelloWorldObject implements Comparable<HelloWorldObject> {
     public String getName() { return name; }
     public void setName(final String name) { this.name = name; }
 
+
     @javax.jdo.annotations.Column(allowsNull = "true", length = 4000)
     @Property(editing = Editing.ENABLED)
     private String notes;
diff --git a/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObjects.java b/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
index 92bd565..2c776f5 100644
--- a/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
+++ b/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
@@ -20,7 +20,7 @@ package domainapp.dom.impl;
 
 import java.util.List;
 
-import org.datanucleus.query.typesafe.TypesafeQuery;
+import javax.jdo.JDOQLTypedQuery;
 
 import org.apache.isis.applib.annotation.Action;
 import org.apache.isis.applib.annotation.DomainService;
@@ -31,9 +31,9 @@ import org.apache.isis.applib.annotation.ParameterLayout;
 import org.apache.isis.applib.annotation.RestrictTo;
 import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
-import org.apache.isis.applib.services.registry.ServiceRegistry;
 import org.apache.isis.applib.services.repository.RepositoryService;
 
+
 @DomainService(
         nature = NatureOfService.VIEW_MENU_ONLY,
         objectType = "helloworld.HelloWorldObjects"
@@ -52,7 +52,7 @@ public class HelloWorldObjects {
     @Action(semantics = SemanticsOf.SAFE)
     @MemberOrder(sequence = "2")
     public List<HelloWorldObject> findByName(final String name) {
-        TypesafeQuery<HelloWorldObject> q = isisJdoSupport.newTypesafeQuery(HelloWorldObject.class);
+        JDOQLTypedQuery<HelloWorldObject> q = isisJdoSupport.newTypesafeQuery(HelloWorldObject.class);
         final QHelloWorldObject cand = QHelloWorldObject.candidate();
         q = q.filter(
                 cand.name.indexOf(q.stringParameter("name")).ne(-1)
@@ -64,7 +64,8 @@ public class HelloWorldObjects {
     @Action(semantics = SemanticsOf.SAFE, restrictTo = RestrictTo.PROTOTYPING)
     @MemberOrder(sequence = "3")
     public List<HelloWorldObject> listAll() {
-        return repositoryService.allInstances(HelloWorldObject.class);
+        return isisJdoSupport.newTypesafeQuery(HelloWorldObject.class)
+                .executeList();
     }
 
     @javax.inject.Inject
diff --git a/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObjects.java b/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObjects.java
index 335f9d0..d77fe47 100644
--- a/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObjects.java
+++ b/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObjects.java
@@ -20,7 +20,7 @@ package domainapp.modules.simple.dom.impl;
 
 import java.util.List;
 
-import org.datanucleus.query.typesafe.TypesafeQuery;
+import javax.jdo.JDOQLTypedQuery;
 
 import org.apache.isis.applib.annotation.Action;
 import org.apache.isis.applib.annotation.ActionLayout;
@@ -35,7 +35,6 @@ import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
 import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
 import org.apache.isis.applib.services.repository.RepositoryService;
-import org.apache.isis.applib.services.xactn.TransactionService;
 
 @DomainService(
         nature = NatureOfService.VIEW_MENU_ONLY,
@@ -63,7 +62,7 @@ public class SimpleObjects {
             @ParameterLayout(named="Name")
             final String name
     ) {
-        TypesafeQuery<SimpleObject> q = isisJdoSupport.newTypesafeQuery(SimpleObject.class);
+        JDOQLTypedQuery<SimpleObject> q = isisJdoSupport.newTypesafeQuery(SimpleObject.class);
         final QSimpleObject cand = QSimpleObject.candidate();
         q = q.filter(
                 cand.name.indexOf(q.stringParameter("name")).ne(-1)
@@ -74,7 +73,7 @@ public class SimpleObjects {
 
     @Programmatic
     public SimpleObject findByNameExact(final String name) {
-        TypesafeQuery<SimpleObject> q = isisJdoSupport.newTypesafeQuery(SimpleObject.class);
+        JDOQLTypedQuery<SimpleObject> q = isisJdoSupport.newTypesafeQuery(SimpleObject.class);
         final QSimpleObject cand = QSimpleObject.candidate();
         q = q.filter(
                 cand.name.eq(q.stringParameter("name"))

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.