You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2017/10/27 07:50:25 UTC

[isis] branch dev/2.0.0/ISIS-1762-j8-utils created (now 4a9a3aa)

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

ahuber pushed a change to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git.


      at 4a9a3aa  ISIS-1762 fixing won't compile on eclipse

This branch includes the following new commits:

     new ccb0bc9  ISIS-1276: updates references for datanucleus.
     new 2d48766  ISIS-1276: updates core to compile under JDK 1.8 only
     new dd39ec6  ISIS-1276: updates applib, replaces references of TypesafeQuery to be instead JDOQLTypedQuery
     new 5565822  ISIS-1276: fixes compile issues in metamodel and runtime
     new f0900ad  ISIS-1276: fixes compile issue in specsupport
     new be40ecf  ISIS-1276: fixes algorithm for lookup of datastore id's, at least
     new 4ab0b54  ISIS-1723: removes jdo applib's Auditable interface and @Auditable annotation
     new bf3d034  ISIS-1724: removes the deprecated IsisJdoSupport in the jdo applib
     new 2abad13  ISIS-1725: requires that an AppManifest is supplied (used to obtain list of entities).
     new 5c81e1c  ISIS-1727: uses lambda in IsisSessionFactoryBuilder
     new a5419e9  ISIS-1726: generalizes the logic that searches for @PersistenceCapable entities, to also take into account meta-annotations.
     new a8b21e7  ISIS-1728: uses typesafe queries for helloworld
     new 4a9a3aa  ISIS-1762 fixing won't compile on eclipse

The 13 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] 06/13: ISIS-1276: fixes algorithm for lookup of datastore id's, at least

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
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>.

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

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

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

    ISIS-1728: uses typesafe queries for helloworld
---
 .../main/java/domainapp/dom/impl/HelloWorldObject.java  | 17 ++++++-----------
 .../main/java/domainapp/dom/impl/HelloWorldObjects.java | 15 ++++++++-------
 2 files changed, 14 insertions(+), 18 deletions(-)

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 40708dd..90ad57a 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
@@ -42,27 +42,19 @@ import org.apache.isis.applib.services.title.TitleService;
 
 import lombok.AccessLevel;
 
-@javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "helloworld" )
+@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.Queries({
-        @javax.jdo.annotations.Query(
-                name = "findByName",
-                value = "SELECT "
-                        + "FROM domainapp.dom.impl.HelloWorldObject "
-                        + "WHERE name.indexOf(:name) >= 0 ")
-})
-@javax.jdo.annotations.Unique(name="HelloWorldObject_name_UNQ", members = {"name"})
-@DomainObject(auditing = Auditing.ENABLED)
+@DomainObject(auditing = Auditing.ENABLED, editing = Editing.DISABLED)
 @DomainObjectLayout()  // trigger events etc.
 @lombok.RequiredArgsConstructor(staticName = "create")
 @lombok.Getter @lombok.Setter
 public class HelloWorldObject implements Comparable<HelloWorldObject> {
 
 
+    @javax.jdo.annotations.Unique
     @javax.jdo.annotations.Column(allowsNull = "false", length = 40)
     @lombok.NonNull
-    @Property(editing = Editing.DISABLED)
     @Title(prepend = "Object: ")
     private String name;
 
@@ -102,14 +94,17 @@ public class HelloWorldObject implements Comparable<HelloWorldObject> {
 
     //region > injected services
     @javax.inject.Inject
+    @javax.jdo.annotations.NotPersistent
     @lombok.Getter(AccessLevel.NONE) @lombok.Setter(AccessLevel.NONE)
     RepositoryService repositoryService;
 
     @javax.inject.Inject
+    @javax.jdo.annotations.NotPersistent
     @lombok.Getter(AccessLevel.NONE) @lombok.Setter(AccessLevel.NONE)
     TitleService titleService;
 
     @javax.inject.Inject
+    @javax.jdo.annotations.NotPersistent
     @lombok.Getter(AccessLevel.NONE) @lombok.Setter(AccessLevel.NONE)
     MessageService messageService;
     //endregion
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 a8c4d39..fbb10a8 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
@@ -28,7 +28,7 @@ import org.apache.isis.applib.annotation.Parameter;
 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.query.QueryDefault;
+import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
 import org.apache.isis.applib.services.registry.ServiceRegistry2;
 import org.apache.isis.applib.services.repository.RepositoryService;
 
@@ -50,17 +50,15 @@ public class HelloWorldObjects {
     @Action(semantics = SemanticsOf.SAFE)
     @MemberOrder(sequence = "2")
     public List<HelloWorldObject> findByName(final String name) {
-        return repositoryService.allMatches(
-                new QueryDefault<>(
-                        HelloWorldObject.class,
-                        "findByName",
-                        "name", name));
+        return isisJdoSupport.executeQuery(HelloWorldObject.class,
+                QHelloWorldObject.candidate().name.startsWith(name));
     }
 
     @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();
     }
 
 
@@ -69,6 +67,9 @@ public class HelloWorldObjects {
     RepositoryService repositoryService;
 
     @javax.inject.Inject
+    IsisJdoSupport isisJdoSupport;
+
+    @javax.inject.Inject
     ServiceRegistry2 serviceRegistry;
     //endregion
 

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

[isis] 10/13: ISIS-1727: uses lambda in IsisSessionFactoryBuilder

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 5c81e1ccee1756d00acb415c8679ac43275f7b9c
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 3002b3f..913b869 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
@@ -199,22 +199,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] 01/13: ISIS-1276: updates references for datanucleus.

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

commit ccb0bc90a5174f3b31f8797b90ce83f0b93b1add
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  |  8 +++----
 5 files changed, 19 insertions(+), 56 deletions(-)

diff --git a/core/applib/pom.xml b/core/applib/pom.xml
index c048c8c..3776e8f 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 d898beb..8aec65b 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>
 
@@ -1950,8 +1949,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 2c84d64..6783db0 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 646de10..193ca67 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>
@@ -42,7 +42,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 9ee473a..fd6dbee 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>
@@ -44,9 +44,9 @@
 
         <lombok.version>1.16.18</lombok.version>
 
-        <compiler-plugin.source>1.7</compiler-plugin.source>
-        <compiler-plugin.target>1.7</compiler-plugin.target>
-        <compiler-plugin.compilerArgument></compiler-plugin.compilerArgument>
+        <compiler-plugin.source>1.8</compiler-plugin.source>
+        <compiler-plugin.target>1.8</compiler-plugin.target>
+        <compiler-plugin.compilerArgument>-parameters</compiler-plugin.compilerArgument>
 
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

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

[isis] 13/13: ISIS-1762 fixing won't compile on eclipse

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 4a9a3aafaf5992d214637c3d5232df120ff045bd
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Oct 27 09:49:32 2017 +0200

    ISIS-1762 fixing won't compile on eclipse
---
 .../viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java b/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
index 08205b2..da2cb46 100644
--- a/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
+++ b/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
@@ -53,7 +53,7 @@ public class LowestCommonSuperclassClosureTest {
         assertLowestCommonOfListIs(listOf(Lion.class, Lion.class), Lion.class);
     }
     
-    private static void assertLowestCommonOfListIs(List<Class<? extends Object>> list, Class<?> expected) {
+    private static void assertLowestCommonOfListIs(List<Class<?>> list, Class<?> expected) {
         EntityCollectionModel.LowestCommonSuperclassClosure closure = new EntityCollectionModel.LowestCommonSuperclassClosure();
         IterableExtensions.fold(list, closure);
         assertThat(closure.getLowestCommonSuperclass(), IsisMatchers.classEqualTo(expected));

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

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

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 55658227cb1497c46c05dd85a9a53ec0ab5b12f5
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
---
 .../facets/object/parseable/ParserUtil.java        |  2 +-
 .../value/vsp/ValueSemanticsProviderUtil.java      |  3 +--
 ...ionParameterAbstractTest_getId_and_getName.java |  6 ++---
 .../DataNucleusApplicationComponents.java          |  2 +-
 .../persistence/PersistenceSessionFactory.java     |  2 +-
 .../CreateSchemaObjectFromClassMetadata.java       |  3 ++-
 .../service/support/IsisJdoSupportImpl.java        | 27 +++++++++-------------
 7 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parseable/ParserUtil.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parseable/ParserUtil.java
index 3f70174..acc1105 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parseable/ParserUtil.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parseable/ParserUtil.java
@@ -43,7 +43,7 @@ public final class ParserUtil {
     public static Class<? extends Parser<?>> parserOrNull(final Class<?> candidateClass, final String classCandidateName) {
         @SuppressWarnings("rawtypes")
         final Class type = candidateClass != null ? ClassUtil.implementingClassOrNull(candidateClass.getName(), Parser.class, FacetHolder.class) : null;
-        return type != null ? type : ClassUtil.implementingClassOrNull(classCandidateName, Parser.class, FacetHolder.class);
+        return type != null ? type : (Class)ClassUtil.implementingClassOrNull(classCandidateName, Parser.class, FacetHolder.class);
     }
 
 }
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 f93ebe1..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 {
@@ -45,7 +44,7 @@ public final class ValueSemanticsProviderUtil {
     public static Class<? extends ValueSemanticsProvider<?>> valueSemanticsProviderOrNull(final Class<?> candidateClass, final String classCandidateName) {
         @SuppressWarnings("rawtypes")
         final Class clazz = candidateClass != null ? ClassUtil.implementingClassOrNull(candidateClass.getName(), ValueSemanticsProvider.class, FacetHolder.class) : null;
-        return clazz != null ? clazz : ClassUtil.implementingClassOrNull(classCandidateName, ValueSemanticsProvider.class, FacetHolder.class);
+        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 3985ca0..6843e26 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
@@ -164,7 +164,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
                 one(actionParamPeer).getFacet(NamedFacet.class);
                 will(returnValue(null));
 
-                one(parentAction).getParameters((Filter<ObjectActionParameter>) with(anything()));
+                one(parentAction).getParameters(with((Filter<ObjectActionParameter>)anything()));
                 will(returnValue(Lists.newArrayList(objectActionParameter)));
             }
         });
@@ -183,7 +183,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
                 one(actionParamPeer).getFacet(NamedFacet.class);
                 will(returnValue(null));
 
-                one(parentAction).getParameters((Filter<ObjectActionParameter>) with(anything()));
+                one(parentAction).getParameters(with((Filter<ObjectActionParameter>) anything()));
                 will(returnValue(Lists.newArrayList(stubObjectActionParameterString, objectActionParameter, stubObjectActionParameterString2)));
             }
         });
@@ -202,7 +202,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
                 one(actionParamPeer).getFacet(NamedFacet.class);
                 will(returnValue(null));
 
-                one(parentAction).getParameters((Filter<ObjectActionParameter>) with(anything()));
+                one(parentAction).getParameters(with((Filter<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 6470720..696f58b 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] 02/13: ISIS-1276: updates core to compile under JDK 1.8 only

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 2d487666adf53844b8a1bf20fc5eebaeef63a5dd
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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/pom.xml b/core/pom.xml
index 8aec65b..9f30b75 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -57,8 +57,8 @@
         <testsToExclude>**/*IntegrationTest.java</testsToExclude>
 
         <!-- remaining properties should not need to be overridden -->
-        <compileSource>1.7</compileSource>
-        <compileTarget>1.7</compileTarget>
+        <compileSource>1.8</compileSource>
+        <compileTarget>1.8</compileTarget>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
         <dependency.locations.enabled>false</dependency.locations.enabled>
@@ -2081,7 +2081,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] 07/13: ISIS-1723: removes jdo applib's Auditable interface and @Auditable annotation

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 4ab0b5434e701530f0c8e8dc7eb8f9f1576cf553
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
---
 .../jdo/applib/annotations/Auditable.java          | 36 --------
 .../isis/objectstore/jdo/applib/Auditable.java     | 26 ------
 ...AuditableAnnotationInJdoApplibFacetFactory.java | 81 ------------------
 .../AuditableFacetAnnotationInJdoApplib.java       | 33 --------
 .../AuditableFacetMarkerInterfaceInJdoApplib.java  | 32 -------
 ...ableMarkerInterfaceInJdoApplibFacetFactory.java | 56 ------------
 .../GivenAuditableAnnotationFacetFactoryTest.java  | 99 ----------------------
 ...enAuditableFacetMarkerInterfaceFactoryTest.java | 99 ----------------------
 .../PersistenceSessionFactoryMetamodelRefiner.java |  5 --
 9 files changed, 467 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/core/objectstore/jdo/applib/annotations/Auditable.java b/core/applib/src/main/java/org/apache/isis/core/objectstore/jdo/applib/annotations/Auditable.java
deleted file mode 100644
index c903b65..0000000
--- a/core/applib/src/main/java/org/apache/isis/core/objectstore/jdo/applib/annotations/Auditable.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.objectstore.jdo.applib.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * @deprecated use the {@link org.apache.isis.applib.annotation.Audited the applib Audited} annotation instead.
- */
-@Deprecated
-@Inherited
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Auditable {
-}
diff --git a/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/Auditable.java b/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/Auditable.java
deleted file mode 100644
index 8035bfd..0000000
--- a/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/Auditable.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.objectstore.jdo.applib;
-
-/**
- * @deprecated use the {@link org.apache.isis.applib.marker.Auditable the applib Auditable} marker interface instead.
- */
-@Deprecated
-public interface Auditable extends org.apache.isis.applib.marker.Auditable {
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableAnnotationInJdoApplibFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableAnnotationInJdoApplibFacetFactory.java
deleted file mode 100644
index 6c26460..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableAnnotationInJdoApplibFacetFactory.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.objectstore.jdo.metamodel.facets.object.auditable;
-
-
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.facetapi.FacetUtil;
-import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MetaModelValidatorRefiner;
-import org.apache.isis.core.metamodel.facets.Annotations;
-import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.progmodel.DeprecatedMarker;
-import org.apache.isis.core.metamodel.services.ServicesInjector;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorForDeprecatedAnnotation;
-import org.apache.isis.core.objectstore.jdo.applib.annotations.Auditable;
-
-/**
- * Required only for backward compatibility to support the JDO applib's version of the
- * {@link Auditable} annotation.
- *
- * @deprecated
- */
-@Deprecated
-public class AuditableAnnotationInJdoApplibFacetFactory extends FacetFactoryAbstract implements MetaModelValidatorRefiner, DeprecatedMarker {
-
-    private final MetaModelValidatorForDeprecatedAnnotation validator = new MetaModelValidatorForDeprecatedAnnotation(Auditable.class);
-
-    public AuditableAnnotationInJdoApplibFacetFactory() {
-        super(FeatureType.OBJECTS_ONLY);
-    }
-
-    @Override
-    public void process(ProcessClassContext processClassContext) {
-        final Class<?> cls = processClassContext.getCls();
-
-        // only applies to JDO entities; ignore any view models
-        if(!org.datanucleus.enhancement.Persistable.class.isAssignableFrom(cls)) {
-            return;
-        }
-
-        final Auditable annotation = Annotations.getAnnotation(cls, Auditable.class);
-        if (annotation == null) {
-            return;
-        }
-        final AuditableFacetAnnotationInJdoApplib facet = new AuditableFacetAnnotationInJdoApplib(processClassContext.getFacetHolder());
-        FacetUtil.addFacet(validator.flagIfPresent(facet));
-    }
-
-
-    @Override
-    public void refineMetaModelValidator(final MetaModelValidatorComposite metaModelValidator, final IsisConfiguration configuration) {
-        metaModelValidator.add(validator);
-    }
-
-    @Override
-    public void setServicesInjector(final ServicesInjector servicesInjector) {
-        super.setServicesInjector(servicesInjector);
-        IsisConfiguration configuration = servicesInjector.getConfigurationServiceInternal();
-        validator.setConfiguration(configuration);
-    }
-
-
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableFacetAnnotationInJdoApplib.java b/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableFacetAnnotationInJdoApplib.java
deleted file mode 100644
index c6504b1..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableFacetAnnotationInJdoApplib.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.objectstore.jdo.metamodel.facets.object.auditable;
-
-
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.domainobject.auditing.AuditableFacetForAuditedAnnotation;
-
-
-@Deprecated
-public class AuditableFacetAnnotationInJdoApplib extends AuditableFacetForAuditedAnnotation {
-
-    public AuditableFacetAnnotationInJdoApplib(final FacetHolder facetHolder) {
-        super(facetHolder, Enablement.ENABLED);
-    }
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableFacetMarkerInterfaceInJdoApplib.java b/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableFacetMarkerInterfaceInJdoApplib.java
deleted file mode 100644
index 896a400..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableFacetMarkerInterfaceInJdoApplib.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.objectstore.jdo.metamodel.facets.object.auditable;
-
-
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.audit.markerifc.AuditableFacetMarkerInterface;
-
-@Deprecated
-public class AuditableFacetMarkerInterfaceInJdoApplib extends AuditableFacetMarkerInterface {
-
-    public AuditableFacetMarkerInterfaceInJdoApplib(FacetHolder facetHolder) {
-        super(facetHolder);
-    }
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableMarkerInterfaceInJdoApplibFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableMarkerInterfaceInJdoApplibFacetFactory.java
deleted file mode 100644
index dd1ab07..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableMarkerInterfaceInJdoApplibFacetFactory.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.objectstore.jdo.metamodel.facets.object.auditable;
-
-
-import org.apache.isis.core.metamodel.facetapi.FacetUtil;
-import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.progmodel.DeprecatedMarker;
-import org.apache.isis.objectstore.jdo.applib.Auditable;
-
-/**
- * Required only for backward compatibility to support the JDO applib's version of the
- * {@link Auditable} marker interface.
- */
-@Deprecated
-public class AuditableMarkerInterfaceInJdoApplibFacetFactory extends FacetFactoryAbstract implements DeprecatedMarker {
-
-    public AuditableMarkerInterfaceInJdoApplibFacetFactory() {
-        super(FeatureType.OBJECTS_ONLY);
-    }
-
-    @Override
-    public void process(ProcessClassContext processClassContext) {
-        final Class<?> cls = processClassContext.getCls();
-
-        // only applies to JDO entities; ignore any view models
-        if(!org.datanucleus.enhancement.Persistable.class.isAssignableFrom(cls)) {
-            return;
-        }
-
-        if(!Auditable.class.isAssignableFrom(cls)) {
-            return;
-        }
-        FacetUtil.addFacet(new AuditableFacetMarkerInterfaceInJdoApplib(
-                processClassContext.getFacetHolder()));
-    }
-
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/GivenAuditableAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/GivenAuditableAnnotationFacetFactoryTest.java
deleted file mode 100644
index 5353d03..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/GivenAuditableAnnotationFacetFactoryTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.objectstore.jdo.metamodel.facets.object.auditable;
-
-import java.util.List;
-
-import javax.jdo.annotations.PersistenceCapable;
-
-import org.datanucleus.enhancement.Persistable;
-import org.junit.Assert;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.FacetFactory;
-import org.apache.isis.core.metamodel.facets.object.audit.AuditableFacet;
-import org.apache.isis.core.metamodel.facets.object.domainobject.auditing.AuditableFacetForAuditedAnnotation;
-import org.apache.isis.core.objectstore.jdo.applib.annotations.Auditable;
-
-
-
-public class GivenAuditableAnnotationFacetFactoryTest extends
-        AbstractFacetFactoryTest {
-
-    private AuditableAnnotationInJdoApplibFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new AuditableAnnotationInJdoApplibFacetFactory();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-    public void testFeatureTypes() {
-        final List<FeatureType> featureTypes = facetFactory
-                .getFeatureTypes();
-        Assert.assertTrue(contains(featureTypes, FeatureType.OBJECT));
-        assertFalse(contains(featureTypes, FeatureType.PROPERTY));
-        assertFalse(contains(featureTypes, FeatureType.COLLECTION));
-        Assert.assertFalse(contains(featureTypes, FeatureType.ACTION));
-        assertFalse(contains(featureTypes,
-                FeatureType.ACTION_PARAMETER_SCALAR));
-    }
-
-    public void testAuditableAnnotationPickedUpOnClass() {
-        @Auditable abstract class Customer implements Persistable {
-        }
-
-        facetFactory.process(new FacetFactory.ProcessClassContext(Customer.class, methodRemover, facetHolder));
-
-        final Facet facet = facetHolder.getFacet(AuditableFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof AuditableFacetForAuditedAnnotation);
-    }
-
-    public void testIfNoAuditableAnnotationThenNoFacet() {
-
-        abstract class Customer implements Persistable {
-        }
-
-        facetFactory.process(new FacetFactory.ProcessClassContext(Customer.class, methodRemover, facetHolder));
-
-        final Facet facet = facetHolder.getFacet(AuditableFacet.class);
-        assertNull(facet);
-    }
-
-
-    public void testNoMethodsRemoved() {
-        @PersistenceCapable
-        abstract class Customer implements Persistable {
-        }
-
-        facetFactory.process(new FacetFactory.ProcessClassContext(Customer.class, methodRemover, facetHolder));
-
-        assertNoMethodsRemoved();
-    }
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/GivenAuditableFacetMarkerInterfaceFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/GivenAuditableFacetMarkerInterfaceFactoryTest.java
deleted file mode 100644
index ebed146..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/GivenAuditableFacetMarkerInterfaceFactoryTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.objectstore.jdo.metamodel.facets.object.auditable;
-
-import java.util.List;
-
-import javax.jdo.annotations.PersistenceCapable;
-
-import org.datanucleus.enhancement.Persistable;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.FacetFactory;
-import org.apache.isis.core.metamodel.facets.object.audit.AuditableFacet;
-import org.apache.isis.core.metamodel.facets.object.audit.markerifc.AuditableFacetMarkerInterface;
-import org.apache.isis.objectstore.jdo.applib.Auditable;
-
-import junit.framework.Assert;
-
-
-public class GivenAuditableFacetMarkerInterfaceFactoryTest extends
-        AbstractFacetFactoryTest {
-
-    private AuditableMarkerInterfaceInJdoApplibFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new AuditableMarkerInterfaceInJdoApplibFacetFactory();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-    public void testFeatureTypes() {
-        final List<FeatureType> featureTypes = facetFactory
-                .getFeatureTypes();
-        Assert.assertTrue(contains(featureTypes, FeatureType.OBJECT));
-        assertFalse(contains(featureTypes, FeatureType.PROPERTY));
-        assertFalse(contains(featureTypes, FeatureType.COLLECTION));
-        Assert.assertFalse(contains(featureTypes, FeatureType.ACTION));
-        assertFalse(contains(featureTypes,
-                FeatureType.ACTION_PARAMETER_SCALAR));
-    }
-
-    public void testAuditableMarkerInterfacePickedUpOnClass() {
-        abstract class Customer implements Auditable, Persistable {
-        }
-
-        facetFactory.process(new FacetFactory.ProcessClassContext(Customer.class, methodRemover, facetHolder));
-
-        final Facet facet = facetHolder.getFacet(AuditableFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof AuditableFacetMarkerInterface);
-    }
-
-    public void testIfNoAuditableMarkerInterfaceThenNoFacet() {
-
-        abstract class Customer implements Persistable {
-        }
-
-        facetFactory.process(new FacetFactory.ProcessClassContext(Customer.class, methodRemover, facetHolder));
-
-        final Facet facet = facetHolder.getFacet(AuditableFacet.class);
-        assertNull(facet);
-    }
-
-
-    public void testNoMethodsRemoved() {
-        @PersistenceCapable
-        abstract class Customer implements Persistable {
-        }
-
-        facetFactory.process(new FacetFactory.ProcessClassContext(Customer.class, methodRemover, facetHolder));
-
-        assertNoMethodsRemoved();
-    }
-}
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 3933a98..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
@@ -22,8 +22,6 @@ import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
 import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
-import org.apache.isis.objectstore.jdo.metamodel.facets.object.auditable.AuditableAnnotationInJdoApplibFacetFactory;
-import org.apache.isis.objectstore.jdo.metamodel.facets.object.auditable.AuditableMarkerInterfaceInJdoApplibFacetFactory;
 import org.apache.isis.objectstore.jdo.metamodel.facets.object.datastoreidentity.JdoDatastoreIdentityAnnotationFacetFactory;
 import org.apache.isis.objectstore.jdo.metamodel.facets.object.discriminator.JdoDiscriminatorAnnotationFacetFactory;
 import org.apache.isis.objectstore.jdo.metamodel.facets.object.persistencecapable.JdoPersistenceCapableAnnotationFacetFactory;
@@ -57,9 +55,6 @@ public class PersistenceSessionFactoryMetamodelRefiner implements MetaModelRefin
         // and also MandatoryFacetOnPropertyMandatoryAnnotationFactory
         // and also PropertyAnnotationFactory
         programmingModel.addFactory(new MandatoryFromJdoColumnAnnotationFacetFactory());
-
-        programmingModel.addFactory(new AuditableAnnotationInJdoApplibFacetFactory());
-        programmingModel.addFactory(new AuditableMarkerInterfaceInJdoApplibFacetFactory());
     }
 
     @Override

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

[isis] 05/13: ISIS-1276: fixes compile issue in specsupport

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

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

    ISIS-1276: fixes compile issue in specsupport
---
 .../isis/core/specsupport/scenarios/DomainServiceProviderMockery.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/DomainServiceProviderMockery.java b/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/DomainServiceProviderMockery.java
index 4d4d2cd..30a294c 100644
--- a/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/DomainServiceProviderMockery.java
+++ b/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/DomainServiceProviderMockery.java
@@ -67,7 +67,7 @@ class DomainServiceProviderMockery implements DomainServiceProvider {
                         }
                     });
                     
-                    allowing(mockContainer).persistIfNotAlready(with(anything()));
+                    allowing(mockContainer).persistIfNotAlready(with(any(Object.class)));
                 }
             });
         }

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

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

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 2abad13bf00cc69e02038e6f83e1b8640a84504c
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] 11/13: ISIS-1726: generalizes the logic that searches for @PersistenceCapable entities, to also take into account meta-annotations.

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

commit a5419e9f7cdbb8f71a06b02bf58427b84436c3d9
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                     | 37 ++++++++++++++++------
 1 file changed, 28 insertions(+), 9 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 6616d68..6f599ed 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,17 +19,19 @@
 
 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 com.google.common.base.Function;
 import com.google.common.base.Joiner;
-import com.google.common.base.Predicate;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
@@ -141,21 +143,20 @@ public abstract class IsisComponentProvider {
 
         final Reflections reflections = new Reflections(packages);
         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();
         mixinTypes.addAll(reflections.getTypesAnnotatedWith(Mixin.class));
         final Set<Class<?>> domainObjectTypes = reflections.getTypesAnnotatedWith(DomainObject.class);
         mixinTypes.addAll(
-                Lists.newArrayList(Iterables.filter(domainObjectTypes, new Predicate<Class<?>>() {
-                    @Override
-                    public boolean apply(@Nullable final Class<?> input) {
-                        if(input == null) { return false; }
-                        final DomainObject annotation = input.getAnnotation(DomainObject.class);
-                        return annotation.nature() == Nature.MIXIN;
+                domainObjectTypes.stream().filter(input -> {
+                    if (input == null) {
+                        return false;
                     }
-                }))
+                    final DomainObject annotation = input.getAnnotation(DomainObject.class);
+                    return annotation.nature() == Nature.MIXIN;
+                }).collect(Collectors.toList())
         );
 
         registry.setDomainServiceTypes(domainServiceTypes);
@@ -164,6 +165,24 @@ public abstract class IsisComponentProvider {
         registry.setMixinTypes(mixinTypes);
     }
 
+    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] 03/13: ISIS-1276: updates applib, replaces references of TypesafeQuery to be instead JDOQLTypedQuery

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

commit dd39ec69f2c5e36e52b6fe283b22058caca5d347
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] 08/13: ISIS-1724: removes the deprecated IsisJdoSupport in the jdo applib

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

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git

commit bf3d034f0a720a60a531c5f67bef5266f7044fe5
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
---
 .../jdo/applib/service/support/IsisJdoSupport.java | 28 ----------------------
 .../service/support/IsisJdoSupportImpl.java        |  3 +--
 2 files changed, 1 insertion(+), 30 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/support/IsisJdoSupport.java b/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/support/IsisJdoSupport.java
deleted file mode 100644
index 2d50ce6..0000000
--- a/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/support/IsisJdoSupport.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.objectstore.jdo.applib.service.support;
-
-/**
- * @deprecated - replaced by {@link org.apache.isis.applib.services.jdosupport.IsisJdoSupport}
- */
-@Deprecated
-public interface IsisJdoSupport extends org.apache.isis.applib.services.jdosupport.IsisJdoSupport {
-
-}
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 696f58b..4bfacf6 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
@@ -47,7 +47,6 @@ import org.apache.isis.core.metamodel.services.ServicesInjector;
 import org.apache.isis.core.runtime.persistence.ObjectPersistenceException;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
-import org.apache.isis.objectstore.jdo.applib.service.support.IsisJdoSupport;
 
 
 /**
@@ -62,7 +61,7 @@ import org.apache.isis.objectstore.jdo.applib.service.support.IsisJdoSupport;
         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>.