cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [07/10] cayenne git commit: CAY-2166 Auto-loading of Cayenne modules
Date Sun, 11 Dec 2016 18:00:01 GMT
CAY-2166 Auto-loading of Cayenne modules

* auto-loading of JodaModule
* renamed CayenneJodaModule to JodaModule


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/08fc9f42
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/08fc9f42
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/08fc9f42

Branch: refs/heads/master
Commit: 08fc9f42740b1674b2546c0c2e5bae8c24fcc76e
Parents: 29c640e
Author: Andrus Adamchik <andrus@objectstyle.com>
Authored: Sun Dec 11 17:05:33 2016 +0300
Committer: Andrus Adamchik <andrus@objectstyle.com>
Committed: Sun Dec 11 20:12:48 2016 +0300

----------------------------------------------------------------------
 .../org/apache/cayenne/java8/RuntimeBase.java   |   2 +-
 cayenne-joda/pom.xml                            |   7 ++
 .../apache/cayenne/joda/CayenneJodaModule.java  |  51 --------
 .../org/apache/cayenne/joda/JodaModule.java     |  44 +++++++
 .../apache/cayenne/joda/JodaModuleProvider.java |  43 +++++++
 .../org.apache.cayenne.di.spi.ModuleProvider    |   1 +
 .../org/apache/cayenne/joda/JodaModuleIT.java   | 122 ++++++++++++++++++
 .../cayenne/joda/JodaModuleProviderTest.java    |  30 +++++
 .../org/apache/cayenne/joda/JodaTimeIT.java     | 126 -------------------
 docs/doc/src/main/resources/UPGRADE.txt         |  14 ++-
 10 files changed, 257 insertions(+), 183 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/08fc9f42/cayenne-java8/src/test/java/org/apache/cayenne/java8/RuntimeBase.java
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/java/org/apache/cayenne/java8/RuntimeBase.java b/cayenne-java8/src/test/java/org/apache/cayenne/java8/RuntimeBase.java
index 8b75880..4a8df90 100644
--- a/cayenne-java8/src/test/java/org/apache/cayenne/java8/RuntimeBase.java
+++ b/cayenne-java8/src/test/java/org/apache/cayenne/java8/RuntimeBase.java
@@ -27,7 +27,7 @@ public class RuntimeBase {
     protected ServerRuntime runtime;
 
     @Before
-    public void setUpRuntime() throws Exception {
+    public void setUpRuntime() {
         this.runtime = ServerRuntime.builder().addConfig("cayenne-java8.xml").build();
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/08fc9f42/cayenne-joda/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-joda/pom.xml b/cayenne-joda/pom.xml
index 3f2fbe8..b03b5e5 100644
--- a/cayenne-joda/pom.xml
+++ b/cayenne-joda/pom.xml
@@ -66,6 +66,13 @@
 			<scope>test</scope>
 		</dependency>
 		<dependency>
+			<groupId>org.apache.cayenne</groupId>
+			<artifactId>cayenne-server</artifactId>
+			<version>${project.version}</version>
+			<type>test-jar</type>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
 			<groupId>mockrunner</groupId>
 			<artifactId>mockrunner</artifactId>
 			<scope>test</scope>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/08fc9f42/cayenne-joda/src/main/java/org/apache/cayenne/joda/CayenneJodaModule.java
----------------------------------------------------------------------
diff --git a/cayenne-joda/src/main/java/org/apache/cayenne/joda/CayenneJodaModule.java b/cayenne-joda/src/main/java/org/apache/cayenne/joda/CayenneJodaModule.java
deleted file mode 100644
index 0821b68..0000000
--- a/cayenne-joda/src/main/java/org/apache/cayenne/joda/CayenneJodaModule.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.cayenne.joda;
-
-/**
- * **************************************************************
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.
- * **************************************************************
- */
-
-import org.apache.cayenne.configuration.server.ServerModule;
-import org.apache.cayenne.di.Binder;
-import org.apache.cayenne.di.Module;
-import org.apache.cayenne.joda.access.types.DateTimeType;
-import org.apache.cayenne.joda.access.types.LocalDateTimeType;
-import org.apache.cayenne.joda.access.types.LocalDateType;
-import org.apache.cayenne.joda.access.types.LocalTimeType;
-
-/**
- * Include this module when creating a ServerRuntime in order to add support for
- * joda-time ObjAttributes.
- *
- * @since 4.0
- */
-public class CayenneJodaModule implements Module {
-
-    public CayenneJodaModule() {
-    }
-
-    @Override
-    public void configure(Binder binder) {
-        ServerModule.contributeDefaultTypes(binder)
-                .add(new DateTimeType())
-                .add(new LocalDateType())
-                .add(new LocalTimeType())
-                .add(new LocalDateTimeType());
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/08fc9f42/cayenne-joda/src/main/java/org/apache/cayenne/joda/JodaModule.java
----------------------------------------------------------------------
diff --git a/cayenne-joda/src/main/java/org/apache/cayenne/joda/JodaModule.java b/cayenne-joda/src/main/java/org/apache/cayenne/joda/JodaModule.java
new file mode 100644
index 0000000..8532d63
--- /dev/null
+++ b/cayenne-joda/src/main/java/org/apache/cayenne/joda/JodaModule.java
@@ -0,0 +1,44 @@
+/*
+ *    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.cayenne.joda;
+
+import org.apache.cayenne.configuration.server.ServerModule;
+import org.apache.cayenne.di.Binder;
+import org.apache.cayenne.di.Module;
+import org.apache.cayenne.joda.access.types.DateTimeType;
+import org.apache.cayenne.joda.access.types.LocalDateTimeType;
+import org.apache.cayenne.joda.access.types.LocalDateType;
+import org.apache.cayenne.joda.access.types.LocalTimeType;
+
+/**
+ * Auto-loadable Cayenne module that adds support for Joda {@link org.apache.cayenne.access.types.ExtendedType}
types.
+ *
+ * @since 4.0
+ */
+public class JodaModule implements Module {
+
+    @Override
+    public void configure(Binder binder) {
+        ServerModule.contributeDefaultTypes(binder)
+                .add(new DateTimeType())
+                .add(new LocalDateType())
+                .add(new LocalTimeType())
+                .add(new LocalDateTimeType());
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/08fc9f42/cayenne-joda/src/main/java/org/apache/cayenne/joda/JodaModuleProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-joda/src/main/java/org/apache/cayenne/joda/JodaModuleProvider.java b/cayenne-joda/src/main/java/org/apache/cayenne/joda/JodaModuleProvider.java
new file mode 100644
index 0000000..9c9e204
--- /dev/null
+++ b/cayenne-joda/src/main/java/org/apache/cayenne/joda/JodaModuleProvider.java
@@ -0,0 +1,43 @@
+/*
+ *    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.cayenne.joda;
+
+import org.apache.cayenne.di.Module;
+import org.apache.cayenne.di.spi.ModuleProvider;
+
+/**
+ * @since 4.0
+ */
+public class JodaModuleProvider implements ModuleProvider {
+
+    @Override
+    public Module module() {
+        return new JodaModule();
+    }
+
+    @Override
+    public Class<? extends Module> moduleType() {
+        return JodaModule.class;
+    }
+
+    @Override
+    public Class<? extends Module>[] overrides() {
+        return new Class[0];
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/08fc9f42/cayenne-joda/src/main/resources/META-INF/services/org.apache.cayenne.di.spi.ModuleProvider
----------------------------------------------------------------------
diff --git a/cayenne-joda/src/main/resources/META-INF/services/org.apache.cayenne.di.spi.ModuleProvider
b/cayenne-joda/src/main/resources/META-INF/services/org.apache.cayenne.di.spi.ModuleProvider
new file mode 100644
index 0000000..a4e3ebb
--- /dev/null
+++ b/cayenne-joda/src/main/resources/META-INF/services/org.apache.cayenne.di.spi.ModuleProvider
@@ -0,0 +1 @@
+org.apache.cayenne.joda.JodaModuleProvider
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/08fc9f42/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaModuleIT.java
----------------------------------------------------------------------
diff --git a/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaModuleIT.java b/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaModuleIT.java
new file mode 100644
index 0000000..93282d7
--- /dev/null
+++ b/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaModuleIT.java
@@ -0,0 +1,122 @@
+/*****************************************************************
+ *   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.cayenne.joda;
+
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.configuration.server.ServerRuntime;
+import org.apache.cayenne.joda.db.DateTimeTestEntity;
+import org.apache.cayenne.joda.db.LocalDateTestEntity;
+import org.apache.cayenne.joda.db.LocalDateTimeTestEntity;
+import org.apache.cayenne.joda.db.LocalTimeTestEntity;
+import org.apache.cayenne.query.ObjectSelect;
+import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
+import org.joda.time.LocalDateTime;
+import org.joda.time.LocalTime;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class JodaModuleIT {
+
+    private ServerRuntime runtime;
+
+    @Before
+    public void setUp() {
+        this.runtime = ServerRuntime.builder().addConfig("cayenne-joda.xml").build();
+    }
+
+    @Test
+    public void testJodaDateTime() {
+        ObjectContext context = runtime.newContext();
+
+        DateTimeTestEntity dateTimeTestEntity = context.newObject(DateTimeTestEntity.class);
+        DateTime dateTime = DateTime.now();
+        dateTimeTestEntity.setTimestamp(dateTime);
+
+        context.commitChanges();
+
+        DateTimeTestEntity testRead = ObjectSelect.query(DateTimeTestEntity.class).selectOne(context);
+
+        DateTime timestamp = testRead.getTimestamp();
+        assertNotNull(timestamp);
+        assertEquals(DateTime.class, timestamp.getClass());
+        assertEquals(dateTime, timestamp);
+    }
+
+    @Test
+    public void testJodaLocalDate() {
+        ObjectContext context = runtime.newContext();
+
+        LocalDateTestEntity localDateTestEntity = context.newObject(LocalDateTestEntity.class);
+        LocalDate localDate = LocalDate.now();
+        localDateTestEntity.setDate(localDate);
+
+        context.commitChanges();
+
+        LocalDateTestEntity testRead = ObjectSelect.query(LocalDateTestEntity.class).selectOne(context);
+
+        LocalDate date = testRead.getDate();
+        assertNotNull(date);
+        assertEquals(LocalDate.class, date.getClass());
+        assertEquals(localDate, date);
+    }
+
+    @Test
+    public void testJodaLocalTime() {
+        ObjectContext context = runtime.newContext();
+
+        LocalTimeTestEntity localTimeTestEntity = context.newObject(LocalTimeTestEntity.class);
+        LocalTime localTime = LocalTime.now();
+        localTimeTestEntity.setTime(localTime);
+
+        context.commitChanges();
+
+        LocalTimeTestEntity testRead = ObjectSelect.query(LocalTimeTestEntity.class).selectOne(context);
+
+        LocalTime time = testRead.getTime();
+        assertNotNull(time);
+        assertEquals(LocalTime.class, time.getClass());
+        assertEquals(localTime.getSecondOfMinute(), time.getSecondOfMinute());
+        assertEquals(localTime.getMinuteOfHour(), time.getMinuteOfHour());
+        assertEquals(localTime.getHourOfDay(), time.getHourOfDay());
+    }
+
+    @Test
+    public void testJodaLocalDateTime() {
+        ObjectContext context = runtime.newContext();
+
+        LocalDateTimeTestEntity localDateTimeTestEntity = context.newObject(LocalDateTimeTestEntity.class);
+        LocalDateTime localDateTime = LocalDateTime.now();
+        localDateTimeTestEntity.setTimestamp(localDateTime);
+
+        context.commitChanges();
+
+        LocalDateTimeTestEntity testRead = ObjectSelect.query(LocalDateTimeTestEntity.class).selectOne(context);
+
+        LocalDateTime timestamp = testRead.getTimestamp();
+        assertNotNull(timestamp);
+        assertEquals(LocalDateTime.class, timestamp.getClass());
+        assertEquals(localDateTime, timestamp);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/08fc9f42/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaModuleProviderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaModuleProviderTest.java
b/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaModuleProviderTest.java
new file mode 100644
index 0000000..a0cd1e5
--- /dev/null
+++ b/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaModuleProviderTest.java
@@ -0,0 +1,30 @@
+/*
+ *    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.cayenne.joda;
+
+import org.apache.cayenne.unit.util.ModuleProviderChecker;
+import org.junit.Test;
+
+public class JodaModuleProviderTest {
+
+    @Test
+    public void testProviderPresent() {
+        ModuleProviderChecker.testProviderPresent(JodaModuleProvider.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/08fc9f42/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaTimeIT.java
----------------------------------------------------------------------
diff --git a/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaTimeIT.java b/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaTimeIT.java
deleted file mode 100644
index 56040d3..0000000
--- a/cayenne-joda/src/test/java/org/apache/cayenne/joda/JodaTimeIT.java
+++ /dev/null
@@ -1,126 +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.cayenne.joda;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.sql.SQLException;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.configuration.server.ServerRuntime;
-import org.apache.cayenne.di.Module;
-import org.apache.cayenne.joda.db.DateTimeTestEntity;
-import org.apache.cayenne.joda.db.LocalDateTestEntity;
-import org.apache.cayenne.joda.db.LocalDateTimeTestEntity;
-import org.apache.cayenne.joda.db.LocalTimeTestEntity;
-import org.apache.cayenne.query.ObjectSelect;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
-import org.joda.time.LocalTime;
-import org.junit.Before;
-import org.junit.Test;
-
-public class JodaTimeIT {
-
-	private ServerRuntime runtime;
-
-	@Before
-	public void setUp() throws Exception {
-		Module jodaModule = new CayenneJodaModule();
-		this.runtime = new ServerRuntime("cayenne-joda.xml", jodaModule);
-	}
-
-	@Test
-	public void testJodaDateTime() throws SQLException {
-		ObjectContext context = runtime.newContext();
-
-		DateTimeTestEntity dateTimeTestEntity = context.newObject(DateTimeTestEntity.class);
-		DateTime dateTime = DateTime.now();
-		dateTimeTestEntity.setTimestamp(dateTime);
-
-		context.commitChanges();
-
-		DateTimeTestEntity testRead = ObjectSelect.query(DateTimeTestEntity.class).selectOne(context);
-
-		DateTime timestamp = testRead.getTimestamp();
-		assertNotNull(timestamp);
-		assertEquals(DateTime.class, timestamp.getClass());
-		assertEquals(dateTime, timestamp);
-	}
-
-	@Test
-	public void testJodaLocalDate() {
-		ObjectContext context = runtime.newContext();
-
-		LocalDateTestEntity localDateTestEntity = context.newObject(LocalDateTestEntity.class);
-		LocalDate localDate = LocalDate.now();
-		localDateTestEntity.setDate(localDate);
-
-		context.commitChanges();
-
-		LocalDateTestEntity testRead = ObjectSelect.query(LocalDateTestEntity.class).selectOne(context);
-
-		LocalDate date = testRead.getDate();
-		assertNotNull(date);
-		assertEquals(LocalDate.class, date.getClass());
-		assertEquals(localDate, date);
-	}
-
-	@Test
-	public void testJodaLocalTime() {
-		ObjectContext context = runtime.newContext();
-
-		LocalTimeTestEntity localTimeTestEntity = context.newObject(LocalTimeTestEntity.class);
-		LocalTime localTime = LocalTime.now();
-		localTimeTestEntity.setTime(localTime);
-
-		context.commitChanges();
-
-		LocalTimeTestEntity testRead = ObjectSelect.query(LocalTimeTestEntity.class).selectOne(context);
-
-		LocalTime time = testRead.getTime();
-		assertNotNull(time);
-		assertEquals(LocalTime.class, time.getClass());
-		assertEquals(localTime.getSecondOfMinute(), time.getSecondOfMinute());
-		assertEquals(localTime.getMinuteOfHour(), time.getMinuteOfHour());
-		assertEquals(localTime.getHourOfDay(), time.getHourOfDay());
-	}
-
-	@Test
-	public void testJodaLocalDateTime() {
-		ObjectContext context = runtime.newContext();
-
-		LocalDateTimeTestEntity localDateTimeTestEntity = context.newObject(LocalDateTimeTestEntity.class);
-		LocalDateTime localDateTime = LocalDateTime.now();
-		localDateTimeTestEntity.setTimestamp(localDateTime);
-
-		context.commitChanges();
-
-		LocalDateTimeTestEntity testRead = ObjectSelect.query(LocalDateTimeTestEntity.class).selectOne(context);
-
-		LocalDateTime timestamp = testRead.getTimestamp();
-		assertNotNull(timestamp);
-		assertEquals(LocalDateTime.class, timestamp.getClass());
-		assertEquals(localDateTime, timestamp);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/08fc9f42/docs/doc/src/main/resources/UPGRADE.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/UPGRADE.txt b/docs/doc/src/main/resources/UPGRADE.txt
index e0b9c39..06be221 100644
--- a/docs/doc/src/main/resources/UPGRADE.txt
+++ b/docs/doc/src/main/resources/UPGRADE.txt
@@ -6,11 +6,15 @@ IMPORTANT: be sure to read all notes for the intermediate releases between
your
 -------------------------------------------------------------------------------
 UPGRADING TO 4.0.M5
 
-* Per CAY-2166, Cayenne supports auto-loading of DI modules. The part of this is a tweak
in DI service override policies.
-  In the previous 4.0 releases custom modules would override "builder" modules (i.e. implicit
modules that wrap around
-  various customizations made in response to the builder method calls). It seemed logical
to reverse this order, and
-  let builder modules override custom modules. As the builder is invoked explicitly when
the stack assembly is performed,
-  while modules can be written without any knowledge of the final stack.
+* Per CAY-2166, Cayenne supports auto-loading of DI modules. There are a few changes worth
mentioning:
+  - Service override policies. In the previous 4.0 milestones custom modules would override
"builder" modules
+  (i.e. implicit modules that wrap around various customizations made in response to the
builder method calls). It
+  seemed logical to reverse this order, and let builder modules override custom modules.
As the builder is
+  invoked explicitly when the stack assembly is performed, while modules can be written without
any knowledge of the
+  final stack.
+  - Module Renaming and Explicit Loading of Modules. If you see compile errors (class not
found for CayenneJodaModule,
+   CayenneJava8Module), just remove explicit loading of those modules. They will be autoloade
if they are on classpath.
+   If you explicitly turned off auto-loading, use the new names for these modules: JodaModule
and Java8Module.
 
 * Per CAY-2164, creating a ServerRuntimeBuilder is done via a static method on ServerRuntime
("ServerRuntime.builder()").
   The previous style (ServerRuntimeBuilder.builder()) is deprecated and will soon be removed,
so you should replace it


Mime
View raw message