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 2018/02/23 14:55:04 UTC
[isis] 03/08: ISIS-1276: fixes compile issues in metamodel and
runtime
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch dev/2.0.0-M2-cherrypicked
in repository https://gitbox.apache.org/repos/asf/isis.git
commit c971848df83cebe86cdce08f77e1e86dae1988bd
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
---
...ionParameterAbstractTest_getId_and_getName.java | 8 ++++---
.../DataNucleusApplicationComponents.java | 2 +-
.../persistence/PersistenceSessionFactory.java | 2 +-
.../CreateSchemaObjectFromClassMetadata.java | 3 ++-
.../service/support/IsisJdoSupportImpl.java | 27 +++++++++-------------
5 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
index 1f3fcc3..3e1eb76 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
@@ -19,6 +19,8 @@
package org.apache.isis.core.metamodel.specloader.specimpl;
+import javax.ws.rs.HEAD;
+
import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
@@ -164,7 +166,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
one(actionParamPeer).getFacet(NamedFacet.class);
will(returnValue(null));
- one(parentAction).getParameters((Predicate<ObjectActionParameter>) with(Expectations.<Predicate>anything()));
+ one(parentAction).getParameters(with(Expectations.<Predicate<ObjectActionParameter>>anything()));
will(returnValue(Lists.newArrayList(objectActionParameter)));
}
});
@@ -183,7 +185,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
one(actionParamPeer).getFacet(NamedFacet.class);
will(returnValue(null));
- one(parentAction).getParameters(with(Expectations.<Predicate>anything()));
+ one(parentAction).getParameters(with(Expectations.<Predicate<ObjectActionParameter>>anything()));
will(returnValue(Lists.newArrayList(stubObjectActionParameterString, objectActionParameter, stubObjectActionParameterString2)));
}
});
@@ -202,7 +204,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
one(actionParamPeer).getFacet(NamedFacet.class);
will(returnValue(null));
- one(parentAction).getParameters(with(Expectations.<Predicate>anything()));
+ one(parentAction).getParameters(with(Expectations.<Predicate<ObjectActionParameter>>anything()));
will(returnValue(Lists.newArrayList(stubObjectActionParameterString, objectActionParameter, stubObjectActionParameterString2)));
}
});
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
index 4e8d9fa..0108c88 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
@@ -160,7 +160,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 ad72168..146f16a 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
@@ -106,7 +106,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 465f19b..1191a46 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
@@ -31,10 +31,11 @@ import org.datanucleus.ClassLoaderResolver;
import org.datanucleus.enhancer.EnhancementNucleusContextImpl;
import org.datanucleus.metadata.AbstractClassMetaData;
import org.datanucleus.metadata.MetaDataListener;
-import org.datanucleus.store.encryption.ConnectionEncryptionProvider;
+import org.datanucleus.store.ConnectionEncryptionProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
/**
* Implementation note: the methods in this class are <tt>protected</tt> to allow for easy subclassing.
*/
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
index a9a2ac5..e5171c9 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
@@ -29,16 +29,14 @@ import java.util.Map;
import java.util.concurrent.Callable;
import javax.jdo.Extent;
+import javax.jdo.JDOQLTypedQuery;
import javax.jdo.PersistenceManager;
import javax.jdo.datastore.JDOConnection;
+import javax.jdo.query.BooleanExpression;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import org.datanucleus.api.jdo.JDOPersistenceManager;
-import org.datanucleus.query.typesafe.BooleanExpression;
-import org.datanucleus.query.typesafe.TypesafeQuery;
-
import org.apache.isis.applib.FatalException;
import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.NatureOfService;
@@ -158,12 +156,9 @@ public class IsisJdoSupportImpl implements IsisJdoSupport {
// temporarily disable concurrency checking while this method is performed
try {
- ConcurrencyChecking.executeWithConcurrencyCheckingDisabled(new Callable<Void>() {
- @Override
- public Void call() {
- getJdoPersistenceManager().deletePersistentAll(instances);
- return null;
- }
+ ConcurrencyChecking.executeWithConcurrencyCheckingDisabled((Callable<Void>) () -> {
+ getJdoPersistenceManager().deletePersistentAll(instances);
+ return null;
});
} catch (final Exception ex) {
throw new FatalException(ex);
@@ -176,31 +171,31 @@ public class IsisJdoSupportImpl implements IsisJdoSupport {
@Programmatic
@Override
public <T> List<T> executeQuery(final Class<T> cls, final BooleanExpression expression) {
- final TypesafeQuery<T> query = newTypesafeQuery(cls).filter(expression);
+ final JDOQLTypedQuery<T> query = newTypesafeQuery(cls).filter(expression);
return executeListAndClose(query);
}
@Programmatic
@Override
public <T> T executeQueryUnique(final Class<T> cls, final BooleanExpression expression) {
- final TypesafeQuery<T> query = newTypesafeQuery(cls).filter(expression);
+ final JDOQLTypedQuery<T> query = newTypesafeQuery(cls).filter(expression);
return executeUniqueAndClose(query);
}
@Programmatic
@Override
- public <T> TypesafeQuery<T> newTypesafeQuery(Class<T> cls) {
- return ((JDOPersistenceManager)getJdoPersistenceManager()).newTypesafeQuery(cls);
+ public <T> JDOQLTypedQuery<T> newTypesafeQuery(Class<T> cls) {
+ return getJdoPersistenceManager().newJDOQLTypedQuery(cls);
}
- private static <T> List<T> executeListAndClose(final TypesafeQuery<T> query) {
+ private static <T> List<T> executeListAndClose(final JDOQLTypedQuery<T> query) {
final List<T> elements = query.executeList();
final List<T> list = Lists.newArrayList(elements);
query.closeAll();
return list;
}
- private static <T> T executeUniqueAndClose(final TypesafeQuery<T> query) {
+ private static <T> T executeUniqueAndClose(final JDOQLTypedQuery<T> query) {
final T result = query.executeUnique();
query.closeAll();
return result;
--
To stop receiving notification emails like this one, please contact
ahuber@apache.org.