CAY-2377.Change RELEASE-NOTES.txt, return code deprecated sicne 4.1
Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/6b299bc5 Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/6b299bc5 Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/6b299bc5 Branch: refs/heads/master Commit: 6b299bc5d62c20fbca9625458842c83a2f75ebf7 Parents: 62056c6 Author: Arseni Bulatski <ancars...@gmail.com> Authored: Wed Nov 15 11:51:49 2017 +0300 Committer: Arseni Bulatski <ancars...@gmail.com> Committed: Thu Dec 7 10:35:40 2017 +0300 ---------------------------------------------------------------------- .../invalidation/InvalidationFunction.java | 39 ++++++++++++++++++++ .../rop/client/ClientModuleTest.java | 5 ++- .../rop/client/ClientRuntimeBuilderTest.java | 5 ++- .../rop/client/ClientRuntimeTest.java | 6 ++- .../org/apache/cayenne/CayenneDataObject.java | 13 +++++++ docs/doc/src/main/resources/RELEASE-NOTES.txt | 1 + .../java/org/apache/cayenne/modeler/Main.java | 9 +---- 7 files changed, 67 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cayenne/blob/6b299bc5/cayenne-cache-invalidation/src/main/java/org/apache/cayenne/cache/invalidation/InvalidationFunction.java ---------------------------------------------------------------------- diff --git a/cayenne-cache-invalidation/src/main/java/org/apache/cayenne/cache/invalidation/InvalidationFunction.java b/cayenne-cache-invalidation/src/main/java/org/apache/cayenne/cache/invalidation/InvalidationFunction.java new file mode 100644 index 0000000..d7d1a96 --- /dev/null +++ b/cayenne-cache-invalidation/src/main/java/org/apache/cayenne/cache/invalidation/InvalidationFunction.java @@ -0,0 +1,39 @@ +/***************************************************************** + * 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.cache.invalidation; + +import org.apache.cayenne.Persistent; + +import java.util.Collection; +import java.util.function.Function; + +/** + * @since 4.0 + * @deprecated since 4.1 plain Function>Persistent, Collection>CacheGroupDescriptor>> can be used. + */ +@Deprecated +public interface InvalidationFunction extends Function<Persistent, Collection<CacheGroupDescriptor>> { + + /** + * @return collection of cache groups to invalidate for given object + */ + Collection<CacheGroupDescriptor> apply(Persistent persistent); + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/6b299bc5/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientModuleTest.java ---------------------------------------------------------------------- diff --git a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientModuleTest.java b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientModuleTest.java index 983d906..2480c26 100644 --- a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientModuleTest.java +++ b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientModuleTest.java @@ -32,7 +32,10 @@ import org.junit.Test; import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; @SuppressWarnings("deprecation") public class ClientModuleTest { http://git-wip-us.apache.org/repos/asf/cayenne/blob/6b299bc5/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilderTest.java ---------------------------------------------------------------------- diff --git a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilderTest.java b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilderTest.java index d5298a1..7ac2e8f 100644 --- a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilderTest.java +++ b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilderTest.java @@ -27,8 +27,11 @@ import java.util.Map; import org.apache.cayenne.DataChannel; import org.apache.cayenne.configuration.Constants; import org.apache.cayenne.configuration.server.ServerModule; -import org.apache.cayenne.di.*; +import org.apache.cayenne.di.DIBootstrap; +import org.apache.cayenne.di.Injector; +import org.apache.cayenne.di.Key; import org.apache.cayenne.di.Module; +import org.apache.cayenne.di.Binder; import org.apache.cayenne.remote.ClientChannel; import org.apache.cayenne.remote.ClientConnection; import org.apache.cayenne.remote.MockClientConnection; http://git-wip-us.apache.org/repos/asf/cayenne/blob/6b299bc5/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeTest.java ---------------------------------------------------------------------- diff --git a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeTest.java b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeTest.java index 0559875..1b28d45 100644 --- a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeTest.java +++ b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeTest.java @@ -33,7 +33,11 @@ import org.junit.Test; import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; @SuppressWarnings("deprecation") public class ClientRuntimeTest { http://git-wip-us.apache.org/repos/asf/cayenne/blob/6b299bc5/cayenne-server/src/main/java/org/apache/cayenne/CayenneDataObject.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/main/java/org/apache/cayenne/CayenneDataObject.java b/cayenne-server/src/main/java/org/apache/cayenne/CayenneDataObject.java index bdef93f..3cad849 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/CayenneDataObject.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/CayenneDataObject.java @@ -124,4 +124,17 @@ public class CayenneDataObject extends BaseDataObject { out.writeObject(values); } + /** + * Convenience method to invoke {@link Cayenne#makePath(String...)} from + * within a DataObject subclass to create a dotted path using the generated + * string constants for attributes and relationships. + * + * @deprecated since 4.1, use {@link Cayenne#makePath(String...)} instead + * @see Cayenne#makePath(String...) + * @since 3.1 + */ + @Deprecated + public static String makePath(String... pathParts) { + return Cayenne.makePath(pathParts); + } } http://git-wip-us.apache.org/repos/asf/cayenne/blob/6b299bc5/docs/doc/src/main/resources/RELEASE-NOTES.txt ---------------------------------------------------------------------- diff --git a/docs/doc/src/main/resources/RELEASE-NOTES.txt b/docs/doc/src/main/resources/RELEASE-NOTES.txt index 01cab73..deb9ec4 100644 --- a/docs/doc/src/main/resources/RELEASE-NOTES.txt +++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt @@ -13,6 +13,7 @@ Date: ---------------------------------- Changes/New Features: +CAY-2377 Cleanup deprecated code. Bug Fixes: http://git-wip-us.apache.org/repos/asf/cayenne/blob/6b299bc5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Main.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Main.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Main.java index 460d374..34edece 100644 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Main.java +++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Main.java @@ -21,7 +21,6 @@ package org.apache.cayenne.modeler; import org.apache.cayenne.configuration.server.ServerModule; import org.apache.cayenne.dbsync.DbSyncModule; -import org.apache.cayenne.di.Binder; import org.apache.cayenne.di.DIBootstrap; import org.apache.cayenne.di.Injector; import org.apache.cayenne.di.Module; @@ -108,13 +107,7 @@ public class Main { protected Collection<Module> appendModules(Collection<Module> modules) { // TODO: this is dirty... "CayenneModeler" is not a project name, and ServerModule is out of place inside // the Modeler... If we need ServerRuntime for certain operations, those should start their own stack... - modules.add(new ServerModule(){ - @Override - public void configure(Binder binder) { - super.configure(binder); - ServerModule.contributeProjectLocations(binder).add("CayenneModeler"); - } - }); + modules.add(new ServerModule()); modules.add(new ProjectModule()); modules.add(new DbSyncModule());