cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [23/30] cayenne git commit: CAY-2377. Remove getName() and setName(String name)
Date Thu, 07 Dec 2017 10:09:52 GMT
CAY-2377. Remove getName() and setName(String name)


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

Branch: refs/heads/master
Commit: 4cd3d7a59d11f4b79febe966ae700d45f8a76671
Parents: 5904907
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Fri Nov 10 12:46:24 2017 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Wed Nov 15 10:27:48 2017 +0300

----------------------------------------------------------------------
 .../cayenne/lifecycle/id/StringIdQuery.java     | 12 ----------
 .../apache/cayenne/access/DataDomainQuery.java  |  5 ----
 .../access/ObjectsFromDataRowsQuery.java        |  5 ----
 .../cayenne/map/EJBQLQueryDescriptor.java       |  1 -
 .../cayenne/map/ProcedureQueryDescriptor.java   |  1 -
 .../cayenne/map/SQLTemplateDescriptor.java      |  1 -
 .../cayenne/map/SelectQueryDescriptor.java      |  1 -
 .../org/apache/cayenne/query/AbstractQuery.java | 25 +-------------------
 .../org/apache/cayenne/query/BatchQuery.java    | 13 ----------
 .../org/apache/cayenne/query/EJBQLQuery.java    | 12 ----------
 .../org/apache/cayenne/query/FluentSelect.java  |  3 +--
 .../org/apache/cayenne/query/IndirectQuery.java | 11 ---------
 .../java/org/apache/cayenne/query/Query.java    | 10 --------
 .../org/apache/cayenne/query/QueryChain.java    | 13 ----------
 .../org/apache/cayenne/query/RefreshQuery.java  |  9 -------
 .../apache/cayenne/remote/IncrementalQuery.java |  5 ----
 .../cayenne/remote/IncrementalSelectQuery.java  | 12 ----------
 .../org/apache/cayenne/remote/RangeQuery.java   |  5 ----
 .../cayenne/map/SQLTemplateDescriptorTest.java  |  8 -------
 .../cayenne/map/SelectQueryDescriptorTest.java  |  9 -------
 .../org/apache/cayenne/query/EJBQLQueryIT.java  | 10 --------
 .../apache/cayenne/query/MockAbstractQuery.java |  4 ----
 .../org/apache/cayenne/query/MockQuery.java     |  5 ----
 .../cayenne/query/ProcedureQueryCacheKeyIT.java |  2 --
 .../cayenne/query/SQLTemplateCacheKeyIT.java    |  2 --
 .../cayenne/query/SQLTemplate_LegacyTest.java   |  6 -----
 .../cayenne/query/SelectQueryCacheKeyIT.java    |  2 --
 .../apache/cayenne/query/SelectQueryTest.java   | 11 ---------
 docs/doc/src/main/resources/UPGRADE.txt         | 15 ++++++++++++
 .../modeler/util/state/DisplayEventType.java    |  5 ++--
 .../org/apache/cayenne/wocompat/EOQuery.java    | 10 ++++----
 .../apache/cayenne/wocompat/EOQueryTest.java    |  1 -
 32 files changed, 25 insertions(+), 209 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/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 3428c67..89646d2 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
@@ -68,9 +68,6 @@ public class StringIdQuery implements Query {
         return Arrays.asList(stringIds);
     }
 
-    @Deprecated
-    protected String name;
-
     protected Collection<String> stringIds;
 
     protected transient Map<String, SelectQuery> idQueriesByEntity;
@@ -247,13 +244,4 @@ public class StringIdQuery implements Query {
         throw new UnsupportedOperationException(
                 "This query was supposed to be replace with a set of SelectQueries during
the route phase");
     }
-
-    @Deprecated
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainQuery.java
index 0922c66..5937cc5 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainQuery.java
@@ -70,11 +70,6 @@ class DataDomainQuery implements Query, QueryMetadata {
         return null;
     }
 
-    @Deprecated
-    public String getName() {
-        return null;
-    }
-
     public void route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)
{
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/access/ObjectsFromDataRowsQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/ObjectsFromDataRowsQuery.java
b/cayenne-server/src/main/java/org/apache/cayenne/access/ObjectsFromDataRowsQuery.java
index f2027f5..a53b310 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/ObjectsFromDataRowsQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/ObjectsFromDataRowsQuery.java
@@ -68,11 +68,6 @@ class ObjectsFromDataRowsQuery implements Query, QueryMetadata {
         return null;
     }
 
-    @Deprecated
-    public String getName() {
-        return null;
-    }
-
     public DataMap getDataMap() {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/map/EJBQLQueryDescriptor.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/EJBQLQueryDescriptor.java
b/cayenne-server/src/main/java/org/apache/cayenne/map/EJBQLQueryDescriptor.java
index ed7f2e0..e3f8029 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/EJBQLQueryDescriptor.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/EJBQLQueryDescriptor.java
@@ -52,7 +52,6 @@ public class EJBQLQueryDescriptor extends QueryDescriptor {
     @Override
     public EJBQLQuery buildQuery() {
         EJBQLQuery ejbqlQuery = new EJBQLQuery(this.getEjbql());
-        ejbqlQuery.setName(this.getName());
         ejbqlQuery.setDataMap(dataMap);
         ejbqlQuery.initWithProperties(this.getProperties());
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/map/ProcedureQueryDescriptor.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/ProcedureQueryDescriptor.java
b/cayenne-server/src/main/java/org/apache/cayenne/map/ProcedureQueryDescriptor.java
index a3ad9cf..4577c55 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/ProcedureQueryDescriptor.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/ProcedureQueryDescriptor.java
@@ -57,7 +57,6 @@ public class ProcedureQueryDescriptor extends QueryDescriptor {
             procedureQuery.setRoot(root);
         }
 
-        procedureQuery.setName(this.getName());
         procedureQuery.setDataMap(dataMap);
         procedureQuery.setResultEntityName(this.getResultEntityName());
         procedureQuery.initWithProperties(this.getProperties());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/map/SQLTemplateDescriptor.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/SQLTemplateDescriptor.java
b/cayenne-server/src/main/java/org/apache/cayenne/map/SQLTemplateDescriptor.java
index e9c14f7..fb1fb69 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/SQLTemplateDescriptor.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/SQLTemplateDescriptor.java
@@ -75,7 +75,6 @@ public class SQLTemplateDescriptor extends QueryDescriptor {
             template.setRoot(root);
         }
 
-        template.setName(name);
         template.setDataMap(dataMap);
         template.initWithProperties(this.getProperties());
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/map/SelectQueryDescriptor.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/SelectQueryDescriptor.java
b/cayenne-server/src/main/java/org/apache/cayenne/map/SelectQueryDescriptor.java
index 7a677fb..6788c5f 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/SelectQueryDescriptor.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/SelectQueryDescriptor.java
@@ -128,7 +128,6 @@ public class SelectQueryDescriptor extends QueryDescriptor {
     public SelectQuery<?> buildQuery() {
         SelectQuery<Object> selectQuery = new SelectQuery<>();
         selectQuery.setRoot(this.getRoot());
-        selectQuery.setName(this.getName());
         selectQuery.setDataMap(dataMap);
         selectQuery.setQualifier(this.getQualifier());
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/query/AbstractQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/AbstractQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/query/AbstractQuery.java
index 8589d0b..7e2dcae 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/AbstractQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/AbstractQuery.java
@@ -39,8 +39,6 @@ public abstract class AbstractQuery extends CacheableQuery {
     protected Object root;
 
     @Deprecated
-    protected String name;
-    @Deprecated
     protected DataMap dataMap;
 
     /**
@@ -52,33 +50,13 @@ public abstract class AbstractQuery extends CacheableQuery {
     }
 
     /**
-     * Returns a symbolic name of the query.
-     * 
-     * @since 1.1
-     */
-    @Deprecated
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Sets a symbolic name of the query.
-     * 
-     * @since 1.1
-     */
-    @Deprecated
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
      * Returns default select parameters.
      * 
      * @since 1.2
      */
     public QueryMetadata getMetaData(EntityResolver resolver) {
         BaseQueryMetadata md = new BaseQueryMetadata();
-        md.resolve(getRoot(), resolver, getName());
+        md.resolve(getRoot(), resolver, null);
         return md;
     }
 
@@ -124,7 +102,6 @@ public abstract class AbstractQuery extends CacheableQuery {
     public String toString() {
         return new ToStringBuilder(this)
                 .append("root", root)
-                .append("name", getName())
                 .toString();
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/query/BatchQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/BatchQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/query/BatchQuery.java
index bc46999..9b0cf47 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/BatchQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/BatchQuery.java
@@ -41,9 +41,6 @@ public abstract class BatchQuery implements Query {
      */
     protected DbEntity dbEntity;
 
-    @Deprecated
-    protected String name;
-
     /**
      * @since 4.0
      */
@@ -67,16 +64,6 @@ public abstract class BatchQuery implements Query {
         return rows;
     }
 
-    @Override
-    @Deprecated
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
     /**
      * Returns default select parameters.
      * 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/query/EJBQLQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/EJBQLQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/query/EJBQLQuery.java
index 64232ce..b01e286 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/EJBQLQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/EJBQLQuery.java
@@ -40,8 +40,6 @@ import java.util.Map;
 public class EJBQLQuery extends CacheableQuery {
 
     @Deprecated
-    protected String name;
-    @Deprecated
     protected DataMap dataMap;
     protected String ejbqlStatement;
     
@@ -129,16 +127,6 @@ public class EJBQLQuery extends CacheableQuery {
         return expression;
     }
 
-    @Deprecated
-    public String getName() {
-        return name;
-    }
-
-    @Deprecated
-    public void setName(String name) {
-        this.name = name;
-    }
-
     /**
      * Returns unmodifiable map of combined named and positional parameters. Positional
      * parameter keys are Integers, while named parameter keys are strings.

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/query/FluentSelect.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/FluentSelect.java b/cayenne-server/src/main/java/org/apache/cayenne/query/FluentSelect.java
index 8f2360c..c5286cb 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/FluentSelect.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/FluentSelect.java
@@ -58,7 +58,7 @@ public abstract class FluentSelect<T> extends IndirectQuery implements
Select<T>
     /**
      * Translates self to a SelectQuery.
      */
-    @SuppressWarnings({"deprecation", "unchecked"})
+    @SuppressWarnings("unchecked")
     @Override
     protected Query createReplacementQuery(EntityResolver resolver) {
 
@@ -87,7 +87,6 @@ public abstract class FluentSelect<T> extends IndirectQuery implements
Select<T>
             throw new CayenneRuntimeException("Undefined root entity of the query");
         }
 
-        replacement.setName(name);
         replacement.setQualifier(where);
         replacement.addOrderings(orderings);
         replacement.setPrefetchTree(prefetches);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/query/IndirectQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/IndirectQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/query/IndirectQuery.java
index 5d9f290..556d0e9 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/IndirectQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/IndirectQuery.java
@@ -51,17 +51,6 @@ public abstract class IndirectQuery implements Query {
 		return getReplacementQuery(resolver).getMetaData(resolver);
 	}
 
-	@Override
-	@Deprecated
-	public String getName() {
-		return name;
-	}
-
-	@Deprecated
-	public void setName(String name) {
-		this.name = name;
-	}
-
 	/**
 	 * Delegates routing to a replacement query.
 	 */

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/query/Query.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/Query.java b/cayenne-server/src/main/java/org/apache/cayenne/query/Query.java
index a3eda27..fac3978 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/Query.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/Query.java
@@ -62,14 +62,4 @@ public interface Query extends Serializable {
      * @since 1.2
      */
     SQLAction createSQLAction(SQLActionVisitor visitor);
-
-    /**
-     * Returns a symbolic name of the query. The name is normally used as a key to find
-     * queries stored in the DataMap.
-     * 
-     * @since 1.1
-     * @deprecated {@link QueryDescriptor#getName()} should be used instead
-     */
-    @Deprecated
-    String getName();
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/query/QueryChain.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/QueryChain.java b/cayenne-server/src/main/java/org/apache/cayenne/query/QueryChain.java
index d13fc6d..be7d047 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/QueryChain.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/QueryChain.java
@@ -38,9 +38,6 @@ public class QueryChain implements Query {
 
     protected Collection<Query> chain;
 
-    @Deprecated
-    protected String name;
-
     /**
      * Creates an empty QueryChain.
      */
@@ -109,16 +106,6 @@ public class QueryChain implements Query {
                 + "and should've been split into separate queries during routing phase.");
     }
 
-    @Deprecated
-    public String getName() {
-        return name;
-    }
-
-    @Deprecated
-    public void setName(String name) {
-        this.name = name;
-    }
-
     /**
      * Returns default metadata.
      */

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/query/RefreshQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/RefreshQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/query/RefreshQuery.java
index cd0fbb6..f1d488d 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/RefreshQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/RefreshQuery.java
@@ -85,10 +85,6 @@ public class RefreshQuery implements Query {
         return new BaseQueryMetadata();
     }
 
-    public String getName() {
-        return null;
-    }
-
     public void route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)
{
         // noop
     }
@@ -138,11 +134,6 @@ public class RefreshQuery implements Query {
                 return wrappedMd;
             }
 
-            @Deprecated
-            public String getName() {
-                return query.getName();
-            }
-
             public void route(
                     QueryRouter router,
                     EntityResolver resolver,

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
b/cayenne-server/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
index c832cd5..51c7946 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
@@ -70,9 +70,4 @@ class IncrementalQuery implements Query {
     public SQLAction createSQLAction(SQLActionVisitor visitor) {
         return query.createSQLAction(visitor);
     }
-
-    @Deprecated
-    public String getName() {
-        return query.getName();
-    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/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 1957337..daca4f8 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
@@ -145,12 +145,6 @@ class IncrementalSelectQuery<T> extends SelectQuery<T> {
 	}
 
 	@Override
-	@Deprecated
-	public String getName() {
-		return query.getName();
-	}
-
-	@Override
 	public List<Ordering> getOrderings() {
 		return query.getOrderings();
 	}
@@ -249,12 +243,6 @@ class IncrementalSelectQuery<T> extends SelectQuery<T> {
 	}
 
 	@Override
-	@Deprecated
-	public void setName(String name) {
-		query.setName(name);
-	}
-
-	@Override
 	public void setPageSize(int pageSize) {
 		query.setPageSize(pageSize);
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/main/java/org/apache/cayenne/remote/RangeQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/remote/RangeQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/remote/RangeQuery.java
index 019d323..f2b5e78 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/remote/RangeQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/remote/RangeQuery.java
@@ -149,11 +149,6 @@ class RangeQuery implements Query {
         throw new UnsupportedOperationException();
     }
 
-    @Deprecated
-    public String getName() {
-        throw new UnsupportedOperationException();
-    }
-
     public void route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)
{
         throw new UnsupportedOperationException();
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/test/java/org/apache/cayenne/map/SQLTemplateDescriptorTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/SQLTemplateDescriptorTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/map/SQLTemplateDescriptorTest.java
index 7bb3631..a2cdea3 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/SQLTemplateDescriptorTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/SQLTemplateDescriptorTest.java
@@ -38,14 +38,6 @@ public class SQLTemplateDescriptorTest {
     }
 
     @Test
-    public void testGetQueryName() throws Exception {
-        SQLTemplateDescriptor builder = QueryDescriptor.sqlTemplateDescriptor();
-        builder.setName("xyz");
-
-        assertEquals("xyz", builder.buildQuery().getName());
-    }
-
-    @Test
     public void testGetQueryRoot() throws Exception {
         DataMap map = new DataMap();
         ObjEntity entity = new ObjEntity("A");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/test/java/org/apache/cayenne/map/SelectQueryDescriptorTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/SelectQueryDescriptorTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/map/SelectQueryDescriptorTest.java
index 4c2a8e3..65db9be 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/SelectQueryDescriptorTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/SelectQueryDescriptorTest.java
@@ -39,15 +39,6 @@ public class SelectQueryDescriptorTest {
     }
 
     @Test
-    public void testGetQueryName() throws Exception {
-        SelectQueryDescriptor builder = QueryDescriptor.selectQueryDescriptor();
-        builder.setRoot("FakeRoot");
-        builder.setName("xyz");
-
-        assertEquals("xyz", builder.buildQuery().getName());
-    }
-
-    @Test
     public void testGetQueryRoot() throws Exception {
         DataMap map = new DataMap();
         ObjEntity entity = new ObjEntity("A");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
index 1225f4b..5e74757 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
@@ -214,16 +214,6 @@ public class EJBQLQueryIT extends ServerCase {
     }
 
     @Test
-    public void testGetName() {
-        String ejbql = "select a FROM Artist a";
-        EJBQLQuery query = new EJBQLQuery(ejbql);
-
-        assertNull(query.getName());
-        query.setName("XYZ");
-        assertEquals("XYZ", query.getName());
-    }
-
-    @Test
     public void testUniqueKeyEntity() {
         // insertValue();
         EntityResolver resolver = runtime.getDataDomain().getEntityResolver();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/test/java/org/apache/cayenne/query/MockAbstractQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/MockAbstractQuery.java
b/cayenne-server/src/test/java/org/apache/cayenne/query/MockAbstractQuery.java
index 62eacf2..e0f00e4 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/MockAbstractQuery.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/MockAbstractQuery.java
@@ -28,10 +28,6 @@ public class MockAbstractQuery extends AbstractQuery {
 
     }
 
-    public MockAbstractQuery(String name) {
-        setName(name);
-    }
-
     @Override
     public SQLAction createSQLAction(SQLActionVisitor visitor) {
         return null;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/test/java/org/apache/cayenne/query/MockQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/MockQuery.java b/cayenne-server/src/test/java/org/apache/cayenne/query/MockQuery.java
index 0373425..c9b3c89 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/MockQuery.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/MockQuery.java
@@ -46,11 +46,6 @@ public class MockQuery implements Query {
         return selecting;
     }
 
-    @Deprecated
-    public String getName() {
-        return null;
-    }
-
     public SQLAction createSQLAction(SQLActionVisitor visitor) {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/test/java/org/apache/cayenne/query/ProcedureQueryCacheKeyIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/ProcedureQueryCacheKeyIT.java
b/cayenne-server/src/test/java/org/apache/cayenne/query/ProcedureQueryCacheKeyIT.java
index eb9ec49..3b451c3 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/ProcedureQueryCacheKeyIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/ProcedureQueryCacheKeyIT.java
@@ -48,7 +48,6 @@ public class ProcedureQueryCacheKeyIT extends ServerCase {
         assertEquals(QueryCacheStrategy.NO_CACHE, md1.getCacheStrategy());
         assertNull(md1.getCacheKey());
 
-        query.setName("XYZ");
         QueryMetadata md2 = query.getMetaData(resolver);
         assertEquals(QueryCacheStrategy.NO_CACHE, md2.getCacheStrategy());
         assertNull(md2.getCacheKey());
@@ -90,7 +89,6 @@ public class ProcedureQueryCacheKeyIT extends ServerCase {
         ProcedureQuery query = new ProcedureQuery("ABC", Artist.class);
 
         query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
-        query.setName("XYZ");
 
         QueryMetadata md1 = query.getMetaData(resolver);
         assertEquals(QueryCacheStrategy.SHARED_CACHE, md1.getCacheStrategy());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplateCacheKeyIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplateCacheKeyIT.java
b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplateCacheKeyIT.java
index b87db01..796220a 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplateCacheKeyIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplateCacheKeyIT.java
@@ -46,7 +46,6 @@ public class SQLTemplateCacheKeyIT extends ServerCase {
         assertEquals(QueryCacheStrategy.NO_CACHE, md1.getCacheStrategy());
         assertNull(md1.getCacheKey());
 
-        query.setName("XYZ");
         QueryMetadata md2 = query.getMetaData(resolver);
         assertEquals(QueryCacheStrategy.NO_CACHE, md2.getCacheStrategy());
         assertNull(md2.getCacheKey());
@@ -82,7 +81,6 @@ public class SQLTemplateCacheKeyIT extends ServerCase {
         SQLTemplate query = new SQLTemplate(Artist.class, "SELECT ME");
 
         query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
-        query.setName("XYZ");
 
         QueryMetadata md1 = query.getMetaData(resolver);
         assertEquals(QueryCacheStrategy.SHARED_CACHE, md1.getCacheStrategy());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplate_LegacyTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplate_LegacyTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplate_LegacyTest.java
index 527a21b..0a72b66 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplate_LegacyTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplate_LegacyTest.java
@@ -39,25 +39,19 @@ public class SQLTemplate_LegacyTest {
 	@Deprecated
 	public void testQueryWithParameters() {
 		SQLTemplate q1 = new SQLTemplate("E1", "SELECT");
-		q1.setName("QName");
 
 		Query q2 = q1.queryWithParameters(Collections.EMPTY_MAP);
 		assertNotNull(q2);
 		assertNotSame(q1, q2);
 		assertTrue(q2 instanceof SQLTemplate);
 
-		assertNull(q2.getName());
-
 		Query q3 = q1.queryWithParameters(Collections.singletonMap("a", "b"));
 		assertNotNull(q3);
 		assertNotSame(q1, q3);
-		assertNull(q3.getName());
-		assertFalse(q1.getName().equals(q3.getName()));
 
 		Query q4 = q1.queryWithParameters(Collections.singletonMap("a", "b"));
 		assertNotNull(q4);
 		assertNotSame(q3, q4);
-		assertEquals(q3.getName(), q4.getName());
 	}
 
 	@SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/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 7c74b1d..398797c 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
@@ -50,7 +50,6 @@ public class SelectQueryCacheKeyIT extends ServerCase {
         assertEquals(QueryCacheStrategy.NO_CACHE, md1.getCacheStrategy());
         assertNull(md1.getCacheKey());
 
-        query.setName("XYZ");
         QueryMetadata md2 = query.getMetaData(resolver);
         assertEquals(QueryCacheStrategy.NO_CACHE, md2.getCacheStrategy());
         assertNull(md2.getCacheKey());
@@ -126,7 +125,6 @@ public class SelectQueryCacheKeyIT extends ServerCase {
         SelectQuery<Artist> query = new SelectQuery<>(Artist.class);
 
         query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
-        query.setName("XYZ");
 
         QueryMetadata md1 = query.getMetaData(resolver);
         assertEquals(QueryCacheStrategy.SHARED_CACHE, md1.getCacheStrategy());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryTest.java b/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryTest.java
index df6f46e..3718fd9 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryTest.java
@@ -140,17 +140,6 @@ public class SelectQueryTest {
 		assertNotNull(q1.getQualifier());
 		assertTrue(q1.getQualifier() != query.getQualifier());
 	}
-
-	@Test
-	public void testQueryWithParamsSkipName() {
-		query.setRoot(Artist.class);
-		query.setDistinct(true);
-		query.setName("name");
-
-		SelectQuery<?> q1 = query.queryWithParameters(Collections.<String, Object>
emptyMap());
-		assertEquals("name", query.getName());
-		assertNull(q1.getName());
-	}
 	
 	@Test
 	public void testAndQualifier() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/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 357972a..199a9c2 100644
--- a/docs/doc/src/main/resources/UPGRADE.txt
+++ b/docs/doc/src/main/resources/UPGRADE.txt
@@ -246,6 +246,21 @@ UPGRADING TO 4.1.M2
       - removed NamedQuery in org.apache.cayenne.query;
       - removed int size() in org.apache.cayenne.jcache.JCacheQueryCache and org.apache.cayenne.cache.NestedQueryCache;
       - removed int size() in org.apache.cayenne.cache.QueryCache;
+      - deprecated getEOName() in org.apache.cayenne.wocompat.EOQuery;
+      - changes in org.apache.cayenne.modeler.DisplayEventType: Query getName change to QueryDescriptor
getName();
+      - removed append(getName()) from toString() in org.apache.cayenne.query.AbstractQuery;
+      - removed getName() from org.apache.cayenne.wocompat.EOQueryTest, org.apache.cayenne.query.SelectQueryTest,
+      org.apache.cayenne.query.EJBQLQueryIT, org.apache.cayenne.query.SQLTemplate_LegacyTest,
org.apache.cayenne.map.SelectQueryDescriptorTest
+      org.apache.cayenne.map.SQLTemplateDescriptorTest;
+      - removed getName() from org.apache.cayenne.query.AbstractQuery, from org.apache.cayenne.query.BatchQuery,
org.apache.cayenne.access.DataDomainQuery,
+      org.apache.cayenne.query.EJBQLQuery, org.apache.cayenne.IncrementalQuery, org.apache.cayenne.remote.IncrementalSelectQuery,
org.apache.cayenne.query.IndirectQuery,
+      org.apache.cayenne.access.ObjectsFromDataRowsQuery, org.apache.cayenne.query.QueryChain,
org.apache.cayenne.remote.RangeQuery, org.apache.cayenne.lifecycle.id.StringIdQuery,
+      org.apache.cayenne.query.MockQuery, org.apache.cayenne.query.RefreshQuery; org.apache.cayenne.query.Query;
+      - removed setName(String name) from org.apache.cayenne.remote.IncrementalSelectQuery,
org.apache.cayenne.map.SelectQueryDescriptor, org.apache.cayenne.map.SQLTemplateDescriptor,
+      org.apache.cayenne.map.ProcedureQueryDescriptor, org.apache.cayenne.query.FluentSelect,
org.apache.cayenne.query.AbstractQuery org.apache.cayenne.query.EJBQLQuery, org.apache.cayenne.BatchQuery
+      org.apache.cayenne.query.QueryChain org.apache.cayenne.lifecycle.StringIdQuery;
+      - removed setName(String name) in org.apache.cayenne.query.SelectQueryCacheKeyIT, org.apache.cayenne.query.SQLTemplateCacheKeyIT,
org.apache.cayenne.query.ProcedureQueryCacheKeyIT,
+      org.apache.cayenne.query.SQLTemplate_LegacyTest, org.apache.cayenne.query.MockAbstractQuery;
 
 UPGRADING TO 4.1.M1
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/state/DisplayEventType.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/state/DisplayEventType.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/state/DisplayEventType.java
index 24afff3..3821762 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/state/DisplayEventType.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/state/DisplayEventType.java
@@ -24,6 +24,7 @@ import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Embeddable;
+import org.apache.cayenne.map.QueryDescriptor;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.pref.ProjectStatePreferences;
 import org.apache.cayenne.query.Query;
@@ -54,8 +55,8 @@ public abstract class DisplayEventType {
             return ((DataMap) object).getName();
         } else if (object instanceof Embeddable) {
             return ((Embeddable) object).getClassName();
-        } else if (object instanceof Query) {
-            return ((Query) object).getName();
+        } else if (object instanceof QueryDescriptor) {
+            return ((QueryDescriptor) object).getName();
         } else {
             return "";
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOQuery.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOQuery.java
b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOQuery.java
index b37d10c..e1d21d8 100644
--- a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOQuery.java
+++ b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOQuery.java
@@ -109,12 +109,12 @@ public class EOQuery<T> extends SelectQuery<T> {
 		}
 	}
 
+	/**
+	 * Since 4.1 is unused.
+	 */
+	@Deprecated
 	public String getEOName() {
-		if (root instanceof EOObjEntity) {
-			return ((EOObjEntity) root).localQueryName(getName());
-		} else {
-			return getName();
-		}
+		return null;
 	}
 
 	public Collection getBindingNames() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/4cd3d7a5/modeler/cayenne-wocompat/src/test/java/org/apache/cayenne/wocompat/EOQueryTest.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-wocompat/src/test/java/org/apache/cayenne/wocompat/EOQueryTest.java
b/modeler/cayenne-wocompat/src/test/java/org/apache/cayenne/wocompat/EOQueryTest.java
index f48d9a2..8dcea27 100644
--- a/modeler/cayenne-wocompat/src/test/java/org/apache/cayenne/wocompat/EOQueryTest.java
+++ b/modeler/cayenne-wocompat/src/test/java/org/apache/cayenne/wocompat/EOQueryTest.java
@@ -51,7 +51,6 @@ public class EOQueryTest {
 
         EOQuery query = new EOQuery(map.getObjEntity("Entity1"), (Map) fspecMap
                 .get("E1FS1"));
-        assertNull(query.getName());
 
         assertNotNull(query.getQualifier());
         assertEquals(


Mime
View raw message