cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [11/30] cayenne git commit: CAY-2377. Cleanup deprecated code.
Date Thu, 07 Dec 2017 10:09:40 GMT
CAY-2377. Cleanup deprecated code.


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

Branch: refs/heads/master
Commit: a10d4bac8f05f9fb76527348f189da4f14695fab
Parents: 44dec79
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Fri Oct 27 15:09:00 2017 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Wed Nov 15 10:27:47 2017 +0300

----------------------------------------------------------------------
 .../cayenne/lifecycle/id/StringIdQuery.java     |  3 +-
 .../org/apache/cayenne/access/DataNode.java     | 20 --------------
 .../server/DataDomainProvider.java              |  1 -
 .../server/DefaultDataNodeFactory.java          |  2 --
 .../org/apache/cayenne/map/EntityResolver.java  | 10 -------
 .../apache/cayenne/query/BaseQueryMetadata.java | 11 --------
 .../apache/cayenne/query/CacheableQuery.java    | 29 +-------------------
 .../cayenne/remote/IncrementalSelectQuery.java  | 10 -------
 .../org/apache/cayenne/access/DataNodeIT.java   |  9 ------
 .../org/apache/cayenne/access/MockDataNode.java | 10 -------
 .../server/DataDomainProviderTest.java          |  2 --
 .../cayenne/query/SelectQueryCacheKeyIT.java    |  2 +-
 docs/doc/src/main/resources/UPGRADE.txt         | 19 ++++++++++++-
 13 files changed, 21 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/StringIdQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/StringIdQuery.java
b/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/StringIdQuery.java
index b207de0..3428c67 100644
--- a/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/StringIdQuery.java
+++ b/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/id/StringIdQuery.java
@@ -70,8 +70,7 @@ public class StringIdQuery implements Query {
 
     @Deprecated
     protected String name;
-    @Deprecated
-    protected DataMap dataMap;
+
     protected Collection<String> stringIds;
 
     protected transient Map<String, SelectQuery> idQueriesByEntity;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/main/java/org/apache/cayenne/access/DataNode.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DataNode.java b/cayenne-server/src/main/java/org/apache/cayenne/access/DataNode.java
index e02ea39..1211bdc 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DataNode.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DataNode.java
@@ -145,26 +145,6 @@ public class DataNode implements QueryEngine {
 	}
 
 	/**
-	 * Returns a location of DataSource of this node. Depending on how this node
-	 * was created, location is either a JNDI name, or a location of node XML
-	 * file, etc.
-	 *
-	 * @deprecated since 4.0. This information is irrelevant at the DataNode level
-	 */
-	@Deprecated
-	public String getDataSourceLocation() {
-		return dataSourceLocation;
-	}
-
-	/**
-	 * @deprecated since 4.0. This information is irrelevant at the DataNode level
-	 */
-	@Deprecated
-	public void setDataSourceLocation(String dataSourceLocation) {
-		this.dataSourceLocation = dataSourceLocation;
-	}
-
-	/**
 	 * Returns a name of DataSourceFactory class for this node.
 	 */
 	public String getDataSourceFactory() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
index 1db8e9c..e616700 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
@@ -130,7 +130,6 @@ public class DataDomainProvider implements Provider<DataDomain>
{
 		}
 
 		dataDomain.getEntityResolver().applyDBLayerDefaults();
-		dataDomain.getEntityResolver().applyObjectLayerDefaults();
 		dataDomain.getEntityResolver().setValueObjectTypeRegistry(valueObjectTypeRegistry);
 
 		for (DataNodeDescriptor nodeDescriptor : descriptor.getNodeDescriptors()) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DefaultDataNodeFactory.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DefaultDataNodeFactory.java
b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DefaultDataNodeFactory.java
index d419eb9..e9eaab7 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DefaultDataNodeFactory.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DefaultDataNodeFactory.java
@@ -74,8 +74,6 @@ public class DefaultDataNodeFactory implements DataNodeFactory {
         dataNode.setSelectTranslatorFactory(selectTranslatorFactory);
         dataNode.setSqlTemplateProcessor(sqlTemplateProcessor);
 
-        dataNode.setDataSourceLocation(nodeDescriptor.getParameters());
-
         DataSource dataSource = dataSourceFactory.getDataSource(nodeDescriptor);
 
         dataNode.setDataSourceFactory(nodeDescriptor.getDataSourceFactoryType());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/main/java/org/apache/cayenne/map/EntityResolver.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/EntityResolver.java b/cayenne-server/src/main/java/org/apache/cayenne/map/EntityResolver.java
index 74668ac..74b36f1 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/EntityResolver.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/EntityResolver.java
@@ -121,16 +121,6 @@ public class EntityResolver implements MappingNamespace, Serializable
{
 
     }
 
-    /**
-     * @since 3.0
-     * @deprecated since 4.0 does nothing. Previously it used to create runtime
-     *             ObjRelationships, that broke a lot of things.
-     */
-    @Deprecated
-    public void applyObjectLayerDefaults() {
-        // noop
-    }
-
     private String getUniqueRelationshipName(Entity entity) {
         String name;
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
b/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
index ecfaa56..e8d8ce9 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
@@ -301,17 +301,6 @@ class BaseQueryMetadata implements QueryMetadata, Serializable {
 	}
 
 	/**
-	 * @since 3.0
-	 * @deprecated since 4.0, use {@link BaseQueryMetadata#setCacheGroup(String)}
-	 */
-	@Deprecated
-	void setCacheGroups(String... groups) {
-		if(groups.length > 0) {
-			this.cacheGroup = groups[0];
-		}
-	}
-
-	/**
 	 * @since 4.0
 	 */
 	@Override

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/main/java/org/apache/cayenne/query/CacheableQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/CacheableQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/query/CacheableQuery.java
index c5b339b..4258191 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/CacheableQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/CacheableQuery.java
@@ -55,18 +55,6 @@ public abstract class CacheableQuery implements Query {
     }
 
     /**
-     * @since 3.0
-     * @deprecated since 4.0, use {@link CacheableQuery#setCacheGroup(String)}
-     */
-    @Deprecated
-    public void setCacheGroups(String... cacheGroups) {
-        getBaseMetaData().setCacheGroups(cacheGroups);
-        if(cacheGroups.length > 1) {
-            logger.warn("Multiple cache groups usage have been deprecated, only first one
will be used.");
-        }
-    }
-
-    /**
      * @since 4.0
      */
     public void setCacheGroup(String cacheGroup) {
@@ -104,22 +92,7 @@ public abstract class CacheableQuery implements Query {
         setCacheGroup(cacheGroup);
     }
 
-    /**
-     * Instructs Cayenne to look for query results in the "shared" cache when
-     * running the query. This is a short-hand notation for:
-     *
-     * <pre>
-     * query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
-     * query.setCacheGroups(&quot;group1&quot;, &quot;group2&quot;);
-     * </pre>
-     * @deprecated since 4.0, use {@link CacheableQuery#useSharedCache(String)}
-     * @since 4.0
-     */
-    @Deprecated
-    public void useSharedCache(String... cacheGroups) {
-        setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
-        setCacheGroups(cacheGroups);
-    }
+
 
     /**
      * Instructs Cayenne to look for query results in the "shared" cache when

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/main/java/org/apache/cayenne/remote/IncrementalSelectQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/remote/IncrementalSelectQuery.java
b/cayenne-server/src/main/java/org/apache/cayenne/remote/IncrementalSelectQuery.java
index 3191f77..1957337 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/remote/IncrementalSelectQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/remote/IncrementalSelectQuery.java
@@ -226,16 +226,6 @@ class IncrementalSelectQuery<T> extends SelectQuery<T> {
 	}
 
 	/**
-	 * @deprecated since 4.0 only first cache group will be used
-	 * 			   use {@link IncrementalSelectQuery#setCacheGroup(String)}
-	 */
-	@Override
-	@Deprecated
-	public void setCacheGroups(String... cacheGroups) {
-		query.setCacheGroups(cacheGroups);
-	}
-
-	/**
 	 * @since 4.0
 	 */
 	@Override

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeIT.java
index 62d3adf..a5edeff 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeIT.java
@@ -47,15 +47,6 @@ public class DataNodeIT extends ServerCase {
     }
 
     @Test
-    public void testDataSourceLocation() throws Exception {
-        String tstName = "tst_name";
-        DataNode node = new DataNode();
-        assertNull(node.getDataSourceLocation());
-        node.setDataSourceLocation(tstName);
-        assertEquals(tstName, node.getDataSourceLocation());
-    }
-
-    @Test
     public void testDataSourceFactory() throws Exception {
         String tstName = "tst_name";
         DataNode node = new DataNode();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/test/java/org/apache/cayenne/access/MockDataNode.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/MockDataNode.java b/cayenne-server/src/test/java/org/apache/cayenne/access/MockDataNode.java
index 6c47515..7ca067a 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/MockDataNode.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/MockDataNode.java
@@ -132,11 +132,6 @@ public class MockDataNode extends DataNode {
     }
 
     @Override
-    public String getDataSourceLocation() {
-        return node.getDataSourceLocation();
-    }
-
-    @Override
     public EntityResolver getEntityResolver() {
         return node.getEntityResolver();
     }
@@ -172,11 +167,6 @@ public class MockDataNode extends DataNode {
     }
 
     @Override
-    public void setDataSourceLocation(String dataSourceLocation) {
-        node.setDataSourceLocation(dataSourceLocation);
-    }
-
-    @Override
     public void setEntityResolver(EntityResolver entityResolver) {
         node.setEntityResolver(entityResolver);
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
index f9a54cb..ad828e0 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
@@ -229,7 +229,6 @@ public class DataDomainProviderTest {
         assertSame(node1, domain.lookupDataNode(map1));
         assertEquals(nodeDescriptor1.getDataSourceFactoryType(), node1.getDataSourceFactory());
         assertNotNull(node1.getDataSource());
-        assertEquals(nodeDescriptor1.getParameters(), node1.getDataSourceLocation());
 
         assertNotNull(node1.getSchemaUpdateStrategy());
         assertEquals(nodeDescriptor1.getSchemaUpdateStrategyType(), node1.getSchemaUpdateStrategy().getClass()
@@ -245,7 +244,6 @@ public class DataDomainProviderTest {
         assertSame(node2, domain.lookupDataNode(map2));
         assertNull(node2.getDataSourceFactory());
         assertNotNull(node2.getDataSource());
-        assertEquals(nodeDescriptor2.getParameters(), node2.getDataSourceLocation());
         assertNotNull(node2.getSchemaUpdateStrategy());
         assertEquals(SkipSchemaUpdateStrategy.class.getName(), node2.getSchemaUpdateStrategy().getClass().getName());
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryCacheKeyIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryCacheKeyIT.java
b/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryCacheKeyIT.java
index 9a194d1..7c74b1d 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryCacheKeyIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryCacheKeyIT.java
@@ -112,7 +112,7 @@ public class SelectQueryCacheKeyIT extends ServerCase {
         assertNull(md1.getCacheGroup());
         
         SelectQuery<Artist> q2 = new SelectQuery<>(Artist.class);
-        q2.useSharedCache("g1", "g2");
+        q2.useSharedCache("g1");
 
         QueryMetadata md2 = q2.getMetaData(resolver);
         assertEquals(QueryCacheStrategy.SHARED_CACHE, md2.getCacheStrategy());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a10d4bac/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 8ae598a..14b8711 100644
--- a/docs/doc/src/main/resources/UPGRADE.txt
+++ b/docs/doc/src/main/resources/UPGRADE.txt
@@ -222,7 +222,24 @@ UPGRADING TO 4.1.M2
       - removed String[] getCacheGroups() in org.apache.cayenne.remote.RangeQuery;
       - removed String[] getCacheGroups() in org.apache.cayenne.lifecycle.id.StringIdQuery;
       - removed String[] getCacheGroups() in org.apache.cayenne.query.QueryMetadata;
-
+      - removed useSharedCache from void testUseSharedCache()  in org.apache.cayenne.query.SelectQueryCacheKeyIT;
+      - removed void useSharedCache(String... cacheGroups) {since 4.0, use CacheableQuery#useSharedCache(String)}
in org.apache.cayenne.query.CacheableQuery;
+      - removed void setCacheGroups(String... groups) {since 4.0, use BaseQueryMetadata#setCacheGroup(String)}
in org.apache.cayenne.query.BaseQueryMetadata;
+      - removed void setCacheGroups(String... cacheGroups) {since 4.0 only first cache group
will be used use IncrementalSelectQuery#setCacheGroup(String)}
+      in org.apache.cayenne.remote.IncrementalSelectQuery;
+      - removed void setCacheGroups(String... cacheGroups) {since 4.0, use CacheableQuery#setCacheGroup(String)}
+      in org.apache.cayenne.query.CacheableQuery;
+      - removed applyObjectLayerDefaults() from org.apache.cayenne.configuration.server.DataDomainProvider;
+      - removed void applyObjectLayerDefaults() {since 4.0 does nothing} in org.apache.cayenne.map.EntityResolver;
+      - removed dataNode.setDataSourceLocation(nodeDescriptor.getParameters()); from org.apache.cayenne.configuration.server.DefaultDataNodeFactory;
+      - removed void testDataSourceLocation() in org.apache.cayenne.access.DataNodeIT;
+      - removed void setDataSourceLocation(String dataSourceLocation) from org.apache.cayenne.access.MockDataNode;
+      - removed void setDataSourceLocation(String dataSourceLocation) {since 4.0. This information
is irrelevant at the DataNode level} from
+      org.apache.cayenne.access.DataNode;
+      - removed assertEquals(nodeDescriptor1.getParameters(), node1.getDataSourceLocation());
from org.apache.cayenne.configuration.server.DataDomainProviderTest;
+      - removed void getDataSourceLocation(String dataSourceLocation) from org.apache.cayenne.access.MockDataNode;
+      - removed void getDataSourceLocation(String dataSourceLocation) {since 4.0. This information
is irrelevant at the DataNode level} from
+      org.apache.cayenne.access.DataNode;
 
 UPGRADING TO 4.1.M1
 


Mime
View raw message