You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/09/19 22:06:36 UTC
[01/12] isis git commit: ISIS-1276: updates references for
datanucleus.
Repository: isis
Updated Branches:
refs/heads/ISIS-1276-dn-5-1 [created] 92b7eb148
ISIS-1276: updates references for datanucleus.
Also updated org.incode:incode-build to 3-SNAPSHOT, and java-mavenmixin-datanucleus to 0.0.5-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/285c18e4
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/285c18e4
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/285c18e4
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: 285c18e40924da7ee11b76d848e176dca6f1ae96
Parents: 4912a4d
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Sep 18 22:13:20 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:04:55 2017 +0100
----------------------------------------------------------------------
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(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/285c18e4/core/applib/pom.xml
----------------------------------------------------------------------
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-->
http://git-wip-us.apache.org/repos/asf/isis/blob/285c18e4/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index f562d79..1d451d1 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>
http://git-wip-us.apache.org/repos/asf/isis/blob/285c18e4/core/unittestsupport/pom.xml
----------------------------------------------------------------------
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>
http://git-wip-us.apache.org/repos/asf/isis/blob/285c18e4/example/application/helloworld/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/helloworld/pom.xml b/example/application/helloworld/pom.xml
index a1cdb4d..844dd9e 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>
http://git-wip-us.apache.org/repos/asf/isis/blob/285c18e4/example/application/simpleapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/pom.xml b/example/application/simpleapp/pom.xml
index 989a275..df3aa4b 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.10</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>
[07/12] isis git commit: ISIS-1723: removes jdo applib's Auditable
interface and @Auditable annotation
Posted by da...@apache.org.
ISIS-1723: removes jdo applib's Auditable interface and @Auditable annotation
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/671235fd
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/671235fd
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/671235fd
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: 671235fdf0d9fb96710c1572b0b2ef8479814e3e
Parents: 19862e4
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Sep 19 22:43:59 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:20 2017 +0100
----------------------------------------------------------------------
.../jdo/applib/annotations/Auditable.java | 36 -------
.../isis/objectstore/jdo/applib/Auditable.java | 26 -----
...itableAnnotationInJdoApplibFacetFactory.java | 81 ----------------
.../AuditableFacetAnnotationInJdoApplib.java | 33 -------
...uditableFacetMarkerInterfaceInJdoApplib.java | 32 -------
...eMarkerInterfaceInJdoApplibFacetFactory.java | 56 -----------
...ivenAuditableAnnotationFacetFactoryTest.java | 99 --------------------
...uditableFacetMarkerInterfaceFactoryTest.java | 99 --------------------
...rsistenceSessionFactoryMetamodelRefiner.java | 5 -
9 files changed, 467 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/671235fd/core/applib/src/main/java/org/apache/isis/core/objectstore/jdo/applib/annotations/Auditable.java
----------------------------------------------------------------------
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 {
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/671235fd/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/Auditable.java
----------------------------------------------------------------------
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 {
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/671235fd/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableAnnotationInJdoApplibFacetFactory.java
----------------------------------------------------------------------
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);
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/671235fd/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableFacetAnnotationInJdoApplib.java
----------------------------------------------------------------------
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);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/671235fd/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableFacetMarkerInterfaceInJdoApplib.java
----------------------------------------------------------------------
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);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/671235fd/core/metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/AuditableMarkerInterfaceInJdoApplibFacetFactory.java
----------------------------------------------------------------------
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()));
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/671235fd/core/metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/GivenAuditableAnnotationFacetFactoryTest.java
----------------------------------------------------------------------
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();
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/671235fd/core/metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/object/auditable/GivenAuditableFacetMarkerInterfaceFactoryTest.java
----------------------------------------------------------------------
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();
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/671235fd/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactoryMetamodelRefiner.java
----------------------------------------------------------------------
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
[11/12] isis git commit: ISIS-1726: generalizes the logic that
searches for @PersistenceCapable entities,
to also take into account meta-annotations.
Posted by da...@apache.org.
ISIS-1726: generalizes the logic that searches for @PersistenceCapable entities, to also take into account meta-annotations.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/c1ed4c95
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/c1ed4c95
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/c1ed4c95
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: c1ed4c957f0ac8a0839495c27b78a82eb22c89b2
Parents: 3b8652b
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Sep 19 22:59:43 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:22 2017 +0100
----------------------------------------------------------------------
.../IsisComponentProvider.java | 37 +++++++++++++++-----
1 file changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/c1ed4c95/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
----------------------------------------------------------------------
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);
[09/12] isis git commit: ISIS-1725: requires that an AppManifest is
supplied (used to obtain list of entities).
Posted by da...@apache.org.
ISIS-1725: requires that an AppManifest is supplied (used to obtain list of entities).
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/2f6ea98f
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/2f6ea98f
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/2f6ea98f
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: 2f6ea98f2ba22146b006f525f5fc85f151cfcef0
Parents: 6e7d42e
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Sep 19 22:55:48 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:21 2017 +0100
----------------------------------------------------------------------
.../persistence/PersistenceSessionFactory.java | 2 +-
.../jdo/service/RegisterEntities.java | 96 ++------------------
2 files changed, 9 insertions(+), 89 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/2f6ea98f/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
----------------------------------------------------------------------
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,
http://git-wip-us.apache.org/repos/asf/isis/blob/2f6ea98f/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
----------------------------------------------------------------------
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;
}
-
}
[10/12] isis git commit: ISIS-1727: uses lambda in
IsisSessionFactoryBuilder
Posted by da...@apache.org.
ISIS-1727: uses lambda in IsisSessionFactoryBuilder
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/3b8652ba
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/3b8652ba
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/3b8652ba
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: 3b8652bae4951a514db8e53f73954349f2c23483
Parents: 2f6ea98
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Sep 19 22:56:54 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:21 2017 +0100
----------------------------------------------------------------------
.../session/IsisSessionFactoryBuilder.java | 25 +++++++++-----------
1 file changed, 11 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/3b8652ba/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
----------------------------------------------------------------------
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);
}
+
}
);
[12/12] isis git commit: ISIS-1728: uses typesafe queries for
helloworld
Posted by da...@apache.org.
ISIS-1728: uses typesafe queries for helloworld
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/92b7eb14
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/92b7eb14
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/92b7eb14
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: 92b7eb14892c15aa070212c76e6f2e1c442660d9
Parents: c1ed4c9
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Sep 19 23:02:07 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:22 2017 +0100
----------------------------------------------------------------------
.../domainapp/dom/impl/HelloWorldObject.java | 22 ++++++++------------
.../domainapp/dom/impl/HelloWorldObjects.java | 15 ++++++-------
2 files changed, 17 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/92b7eb14/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObject.java
----------------------------------------------------------------------
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 b685d9f..77250c6 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
@@ -39,32 +39,25 @@ import org.apache.isis.applib.services.message.MessageService;
import org.apache.isis.applib.services.repository.RepositoryService;
import org.apache.isis.applib.services.title.TitleService;
-@javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "helloworld" )
+import lombok.AccessLevel;
+
+@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)
+@lombok.Getter @lombok.Setter
public class HelloWorldObject implements Comparable<HelloWorldObject> {
public HelloWorldObject(final String name) {
this.name = name;
}
+ @javax.jdo.annotations.Unique
@javax.jdo.annotations.Column(allowsNull = "false", length = 40)
- @lombok.Getter @lombok.Setter
- @Property(editing = Editing.DISABLED)
@Title(prepend = "Object: ")
private String name;
@javax.jdo.annotations.Column(allowsNull = "true", length = 4000)
- @lombok.Getter @lombok.Setter
@Property(editing = Editing.ENABLED)
private String notes;
@@ -99,12 +92,15 @@ public class HelloWorldObject implements Comparable<HelloWorldObject> {
//region > injected services
@javax.inject.Inject
+ @javax.jdo.annotations.NotPersistent @lombok.Getter(AccessLevel.PRIVATE)
RepositoryService repositoryService;
@javax.inject.Inject
+ @javax.jdo.annotations.NotPersistent @lombok.Getter(AccessLevel.PRIVATE)
TitleService titleService;
@javax.inject.Inject
+ @javax.jdo.annotations.NotPersistent @lombok.Getter(AccessLevel.PRIVATE)
MessageService messageService;
//endregion
http://git-wip-us.apache.org/repos/asf/isis/blob/92b7eb14/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
----------------------------------------------------------------------
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 5dc3e20..5ee3e72 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;
@@ -53,17 +53,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();
}
@@ -72,6 +70,9 @@ public class HelloWorldObjects {
RepositoryService repositoryService;
@javax.inject.Inject
+ IsisJdoSupport isisJdoSupport;
+
+ @javax.inject.Inject
ServiceRegistry2 serviceRegistry;
//endregion
[02/12] isis git commit: ISIS-1276: updates core to compile under JDK
1.8 only
Posted by da...@apache.org.
ISIS-1276: updates core to compile under JDK 1.8 only
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/cff6f9b4
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/cff6f9b4
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/cff6f9b4
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: cff6f9b4b2c0f8b772df72630a836e2d29902c43
Parents: 285c18e
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Sep 18 22:16:56 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:02 2017 +0100
----------------------------------------------------------------------
core/pom.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/cff6f9b4/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 1d451d1..c021904 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>
[06/12] isis git commit: ISIS-1276: fixes algorithm for lookup of
datastore id's, at least
Posted by da...@apache.org.
ISIS-1276: fixes algorithm for lookup of datastore id's, at least
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/19862e44
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/19862e44
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/19862e44
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: 19862e44679e562efe5f313f816c88c5a7b4786c
Parents: 2f4b8f1
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Sep 18 22:55:49 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:16 2017 +0100
----------------------------------------------------------------------
.../persistence/spi/JdoObjectIdSerializer.java | 45 ++++++--------------
1 file changed, 13 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/19862e44/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
index 48d4da9..ebb4d40 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
@@ -90,37 +90,14 @@ public final class JdoObjectIdSerializer {
final DatastoreId dnOid = (DatastoreId) jdoOid;
final Object keyValue = dnOid.getKeyAsObject();
- if(false) {
-
- //
- // 1.8.0 original handling, appending a prefix "L_" or whatever
- //
- // if required by user community, we could add a property in isis.properties to enable if requested.
- //
- if(keyValue instanceof String) {
- return "S" + SEPARATOR + keyValue;
- }
- if(keyValue instanceof Long) {
- return "L" + SEPARATOR + keyValue;
- }
-
- if(keyValue instanceof BigInteger) {
- return "B" + SEPARATOR + keyValue;
- }
- if(keyValue instanceof Integer) {
- return "I" + SEPARATOR + keyValue;
- }
-
- } else {
- if( keyValue instanceof String ||
- keyValue instanceof Long ||
- keyValue instanceof BigDecimal || // 1.8.0 did not support BigDecimal
- keyValue instanceof BigInteger ||
- keyValue instanceof Integer) {
-
- // no separator
- return "" + keyValue;
- }
+ if( keyValue instanceof String ||
+ keyValue instanceof Long ||
+ keyValue instanceof BigDecimal || // 1.8.0 did not support BigDecimal
+ keyValue instanceof BigInteger ||
+ keyValue instanceof Integer) {
+
+ // no separator
+ return "" + keyValue;
}
}
@@ -201,7 +178,11 @@ public final class JdoObjectIdSerializer {
// @javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE)
// for one of the common types (prettier handling)
- return idStr + "[OID]" + spec.getFullIdentifier();
+ // in DN 4.1, we did this...
+ // return idStr + "[OID]" + spec.getFullIdentifier();
+
+ // in DN 5.1, we simply do this...
+ return idStr;
}
}
[03/12] isis git commit: ISIS-1276: updates applib,
replaces references of TypesafeQuery to be instead JDOQLTypedQuery
Posted by da...@apache.org.
ISIS-1276: updates applib, replaces references of TypesafeQuery to be instead JDOQLTypedQuery
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/cc6b3614
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/cc6b3614
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/cc6b3614
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: cc6b36143546a173e67ce882d5a7d9be05cf1ac4
Parents: cff6f9b
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Sep 18 22:17:54 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:06 2017 +0100
----------------------------------------------------------------------
.../isis/applib/services/jdosupport/IsisJdoSupport.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/cc6b3614/core/applib/src/main/java/org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java
----------------------------------------------------------------------
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);
}
[05/12] isis git commit: ISIS-1276: fixes compile issue in specsupport
Posted by da...@apache.org.
ISIS-1276: fixes compile issue in specsupport
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/2f4b8f10
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/2f4b8f10
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/2f4b8f10
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: 2f4b8f1039d0c85048df38851c0b7a597bfc48ed
Parents: 9b51ad2
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Sep 18 22:34:29 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:12 2017 +0100
----------------------------------------------------------------------
.../core/specsupport/scenarios/DomainServiceProviderMockery.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/2f4b8f10/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/DomainServiceProviderMockery.java
----------------------------------------------------------------------
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)));
}
});
}
[08/12] isis git commit: ISIS-1724: removes the deprecated
IsisJdoSupport in the jdo applib
Posted by da...@apache.org.
ISIS-1724: removes the deprecated IsisJdoSupport in the jdo applib
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/6e7d42e1
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/6e7d42e1
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/6e7d42e1
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: 6e7d42e14b30857cc561cd68d01fb8c8030576f0
Parents: 671235f
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Sep 19 22:50:00 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:20 2017 +0100
----------------------------------------------------------------------
.../applib/service/support/IsisJdoSupport.java | 28 --------------------
.../service/support/IsisJdoSupportImpl.java | 3 +--
2 files changed, 1 insertion(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/6e7d42e1/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/support/IsisJdoSupport.java
----------------------------------------------------------------------
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 {
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/6e7d42e1/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
----------------------------------------------------------------------
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
[04/12] isis git commit: ISIS-1276: fixes compile issues in metamodel
and runtime
Posted by da...@apache.org.
ISIS-1276: fixes compile issues in metamodel and runtime
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/9b51ad2f
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/9b51ad2f
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/9b51ad2f
Branch: refs/heads/ISIS-1276-dn-5-1
Commit: 9b51ad2fe4fc89f622a32542ce5effe470e14336
Parents: cc6b361
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Sep 18 22:29:13 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Sep 19 23:05:09 2017 +0100
----------------------------------------------------------------------
.../facets/object/parseable/ParserUtil.java | 2 +-
.../value/vsp/ValueSemanticsProviderUtil.java | 3 +--
...ParameterAbstractTest_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(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/9b51ad2f/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parseable/ParserUtil.java
----------------------------------------------------------------------
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);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/9b51ad2f/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/vsp/ValueSemanticsProviderUtil.java
----------------------------------------------------------------------
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);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/9b51ad2f/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
----------------------------------------------------------------------
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)));
}
});
http://git-wip-us.apache.org/repos/asf/isis/blob/9b51ad2f/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
----------------------------------------------------------------------
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");
http://git-wip-us.apache.org/repos/asf/isis/blob/9b51ad2f/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
----------------------------------------------------------------------
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");
http://git-wip-us.apache.org/repos/asf/isis/blob/9b51ad2f/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
----------------------------------------------------------------------
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.
*/
http://git-wip-us.apache.org/repos/asf/isis/blob/9b51ad2f/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
----------------------------------------------------------------------
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;