cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r606433 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/map/ main/java/org/apache/cayenne/query/ test/java/org/apache/cayenne/map/
Date Sat, 22 Dec 2007 09:26:14 GMT
Author: aadamchik
Date: Sat Dec 22 01:26:13 2007
New Revision: 606433

URL: http://svn.apache.org/viewvc?rev=606433&view=rev
Log:
refactoring - renamed QueryBuilder to QueryLoader, as QueryBuilder name may be used for other
purposes
(step 2 ... readded with deprecation)

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/QueryBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/QueryLoaderTest.java
      - copied, changed from r606426, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/QueryBuilderTest.java
Removed:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/QueryBuilderTest.java
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/MapLoader.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/QueryLoader.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/SQLTemplateBuilderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/SelectQueryBuilderTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/MapLoader.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/MapLoader.java?rev=606433&r1=606432&r2=606433&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/MapLoader.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/MapLoader.java
Sat Dec 22 01:26:13 2007
@@ -112,6 +112,32 @@
     public static final String DB_GENERATOR_TYPE_TAG = "db-generator-type";
     public static final String DB_GENERATOR_NAME_TAG = "db-generator-name";
     public static final String DB_KEY_CACHE_SIZE_TAG = "db-key-cache-size";
+    
+    /**
+     * @since 3.0
+     */
+    public static final String OBJ_ENTITY_ROOT = "obj-entity";
+    
+    /**
+     * @since 3.0
+     */
+    public static final String DB_ENTITY_ROOT = "db-entity";
+    
+    /**
+     * @since 3.0
+     */
+    public static final String PROCEDURE_ROOT = "procedure";
+    
+    /**
+     * @since 3.0
+     */
+    public static final String DATA_MAP_ROOT = "data-map";
+    
+    /**
+     * @since 3.0
+     */
+    public static final String JAVA_CLASS_ROOT = "java-class";
+
 
     // Reading from XML
     private DataMap dataMap;

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/QueryBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/QueryBuilder.java?rev=606433&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/QueryBuilder.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/QueryBuilder.java
Sat Dec 22 01:26:13 2007
@@ -0,0 +1,171 @@
+/*****************************************************************
+ *   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.map;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.exp.Expression;
+import org.apache.cayenne.query.Ordering;
+import org.apache.cayenne.query.Query;
+
+/**
+ * A builder that constructs Cayenne queries from abstract configuration information
+ * defined in cayenne-data-map*.dtd. This abstract builder supports values declared in the
+ * DTD, allowing subclasses to define their own Query creation logic.
+ * 
+ * @since 1.1
+ * @author Andrus Adamchik
+ * @deprecated since 3.0 replaced by a non-public class.
+ */
+public abstract class QueryBuilder {
+
+    public static final String OBJ_ENTITY_ROOT = "obj-entity";
+    public static final String DB_ENTITY_ROOT = "db-entity";
+    public static final String PROCEDURE_ROOT = "procedure";
+    public static final String DATA_MAP_ROOT = "data-map";
+    public static final String JAVA_CLASS_ROOT = "java-class";
+
+    protected String name;
+    protected Map<String, String> properties;
+    protected String sql;
+    protected Map<String, String> adapterSql;
+    protected Expression qualifier;
+    protected List<Ordering> orderings;
+    protected List<String> prefetches;
+    protected DataMap dataMap;
+    protected String rootType;
+    protected String rootName;
+    protected String resultEntity;
+
+    /**
+     * Builds a Query object based on internal configuration information.
+     */
+    public abstract Query getQuery();
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Determines query root based on configuration info, falls back to a DataMap root if
+     * the data is invalid.
+     * 
+     * @throws CayenneRuntimeException if a valid root can't be established.
+     */
+    protected Object getRoot() {
+
+        Object root = null;
+
+        if (rootType == null || DATA_MAP_ROOT.equals(rootType) || rootName == null) {
+            root = dataMap;
+        }
+        else if (OBJ_ENTITY_ROOT.equals(rootType)) {
+            root = dataMap.getObjEntity(rootName);
+        }
+        else if (DB_ENTITY_ROOT.equals(rootType)) {
+            root = dataMap.getDbEntity(rootName);
+        }
+        else if (PROCEDURE_ROOT.equals(rootType)) {
+            root = dataMap.getProcedure(rootName);
+        }
+        else if (JAVA_CLASS_ROOT.equals(rootType)) {
+            // setting root to ObjEntity, since creating a Class requires
+            // the knowledge of the ClassLoader
+            root = dataMap.getObjEntityForJavaClass(rootName);
+        }
+
+        return (root != null) ? root : dataMap;
+    }
+
+    public void setResultEntity(String resultEntity) {
+        this.resultEntity = resultEntity;
+    }
+
+    /**
+     * Sets the information pertaining to the root of the query.
+     */
+    public void setRoot(DataMap dataMap, String rootType, String rootName) {
+        this.dataMap = dataMap;
+        this.rootType = rootType;
+        this.rootName = rootName;
+    }
+
+    /**
+     * Adds raw sql. If adapterClass parameter is not null, sets the SQL string to be
+     * adapter-specific. Otherwise it is used as a default SQL string.
+     */
+    public void addSql(String sql, String adapterClass) {
+        if (adapterClass == null) {
+            this.sql = sql;
+        }
+        else {
+            if (adapterSql == null) {
+                adapterSql = new HashMap<String, String>();
+            }
+
+            adapterSql.put(adapterClass, sql);
+        }
+    }
+
+    public void setQualifier(String qualifier) {
+        if (qualifier == null || qualifier.trim().length() == 0) {
+            this.qualifier = null;
+        }
+        else {
+            this.qualifier = Expression.fromString(qualifier.trim());
+        }
+    }
+
+    public void addProperty(String name, String value) {
+        if (properties == null) {
+            properties = new HashMap<String, String>();
+        }
+
+        properties.put(name, value);
+    }
+
+    public void addOrdering(String path, String descending, String ignoreCase) {
+        if (orderings == null) {
+            orderings = new ArrayList<Ordering>();
+        }
+
+        if (path != null && path.trim().length() == 0) {
+            path = null;
+        }
+        boolean isDescending = "true".equalsIgnoreCase(descending);
+        boolean isIgnoringCase = "true".equalsIgnoreCase(ignoreCase);
+        orderings.add(new Ordering(path, !isDescending, isIgnoringCase));
+    }
+
+    public void addPrefetch(String path) {
+        if (path == null || (path != null && path.trim().length() == 0)) {
+            // throw??
+            return;
+        }
+
+        if (prefetches == null) {
+            prefetches = new ArrayList<String>();
+        }
+        prefetches.add(path.trim());
+    }
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/QueryLoader.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/QueryLoader.java?rev=606433&r1=606432&r2=606433&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/QueryLoader.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/QueryLoader.java
Sat Dec 22 01:26:13 2007
@@ -37,13 +37,7 @@
  * @since 3.0
  * @author Andrus Adamchik
  */
-public abstract class QueryLoader {
-
-    public static final String OBJ_ENTITY_ROOT = "obj-entity";
-    public static final String DB_ENTITY_ROOT = "db-entity";
-    public static final String PROCEDURE_ROOT = "procedure";
-    public static final String DATA_MAP_ROOT = "data-map";
-    public static final String JAVA_CLASS_ROOT = "java-class";
+abstract class QueryLoader {
 
     protected String name;
     protected Map<String, String> properties;
@@ -60,9 +54,9 @@
     /**
      * Builds a Query object based on internal configuration information.
      */
-    public abstract Query getQuery();
+    abstract Query getQuery();
 
-    public void setName(String name) {
+    void setName(String name) {
         this.name = name;
     }
 
@@ -76,19 +70,21 @@
 
         Object root = null;
 
-        if (rootType == null || DATA_MAP_ROOT.equals(rootType) || rootName == null) {
+        if (rootType == null
+                || MapLoader.DATA_MAP_ROOT.equals(rootType)
+                || rootName == null) {
             root = dataMap;
         }
-        else if (OBJ_ENTITY_ROOT.equals(rootType)) {
+        else if (MapLoader.OBJ_ENTITY_ROOT.equals(rootType)) {
             root = dataMap.getObjEntity(rootName);
         }
-        else if (DB_ENTITY_ROOT.equals(rootType)) {
+        else if (MapLoader.DB_ENTITY_ROOT.equals(rootType)) {
             root = dataMap.getDbEntity(rootName);
         }
-        else if (PROCEDURE_ROOT.equals(rootType)) {
+        else if (MapLoader.PROCEDURE_ROOT.equals(rootType)) {
             root = dataMap.getProcedure(rootName);
         }
-        else if (JAVA_CLASS_ROOT.equals(rootType)) {
+        else if (MapLoader.JAVA_CLASS_ROOT.equals(rootType)) {
             // setting root to ObjEntity, since creating a Class requires
             // the knowledge of the ClassLoader
             root = dataMap.getObjEntityForJavaClass(rootName);
@@ -97,14 +93,14 @@
         return (root != null) ? root : dataMap;
     }
 
-    public void setResultEntity(String resultEntity) {
+    void setResultEntity(String resultEntity) {
         this.resultEntity = resultEntity;
     }
 
     /**
      * Sets the information pertaining to the root of the query.
      */
-    public void setRoot(DataMap dataMap, String rootType, String rootName) {
+    void setRoot(DataMap dataMap, String rootType, String rootName) {
         this.dataMap = dataMap;
         this.rootType = rootType;
         this.rootName = rootName;
@@ -114,7 +110,7 @@
      * Adds raw sql. If adapterClass parameter is not null, sets the SQL string to be
      * adapter-specific. Otherwise it is used as a default SQL string.
      */
-    public void addSql(String sql, String adapterClass) {
+    void addSql(String sql, String adapterClass) {
         if (adapterClass == null) {
             this.sql = sql;
         }
@@ -127,7 +123,7 @@
         }
     }
 
-    public void setQualifier(String qualifier) {
+    void setQualifier(String qualifier) {
         if (qualifier == null || qualifier.trim().length() == 0) {
             this.qualifier = null;
         }
@@ -136,7 +132,7 @@
         }
     }
 
-    public void addProperty(String name, String value) {
+    void addProperty(String name, String value) {
         if (properties == null) {
             properties = new HashMap<String, String>();
         }
@@ -144,7 +140,7 @@
         properties.put(name, value);
     }
 
-    public void addOrdering(String path, String descending, String ignoreCase) {
+    void addOrdering(String path, String descending, String ignoreCase) {
         if (orderings == null) {
             orderings = new ArrayList<Ordering>();
         }
@@ -157,7 +153,7 @@
         orderings.add(new Ordering(path, !isDescending, isIgnoringCase));
     }
 
-    public void addPrefetch(String path) {
+    void addPrefetch(String path) {
         if (path == null || (path != null && path.trim().length() == 0)) {
             // throw??
             return;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ProcedureQuery.java?rev=606433&r1=606432&r2=606433&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
Sat Dec 22 01:26:13 2007
@@ -28,8 +28,8 @@
 
 import org.apache.cayenne.access.jdbc.ColumnDescriptor;
 import org.apache.cayenne.map.EntityResolver;
+import org.apache.cayenne.map.MapLoader;
 import org.apache.cayenne.map.Procedure;
-import org.apache.cayenne.map.QueryLoader;
 import org.apache.cayenne.util.XMLEncoder;
 import org.apache.cayenne.util.XMLSerializable;
 
@@ -231,7 +231,7 @@
         encoder.print("org.apache.cayenne.map.ProcedureQueryBuilder");
 
         encoder.print("\" root=\"");
-        encoder.print(QueryLoader.PROCEDURE_ROOT);
+        encoder.print(MapLoader.PROCEDURE_ROOT);
 
         String rootString = null;
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java?rev=606433&r1=606432&r2=606433&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
Sat Dec 22 01:26:13 2007
@@ -28,9 +28,9 @@
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.EntityResolver;
+import org.apache.cayenne.map.MapLoader;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.Procedure;
-import org.apache.cayenne.map.QueryLoader;
 import org.apache.cayenne.util.Util;
 import org.apache.cayenne.util.XMLEncoder;
 import org.apache.cayenne.util.XMLSerializable;
@@ -183,27 +183,27 @@
         String rootType = null;
 
         if (root instanceof String) {
-            rootType = QueryLoader.OBJ_ENTITY_ROOT;
+            rootType = MapLoader.OBJ_ENTITY_ROOT;
             rootString = root.toString();
         }
         else if (root instanceof ObjEntity) {
-            rootType = QueryLoader.OBJ_ENTITY_ROOT;
+            rootType = MapLoader.OBJ_ENTITY_ROOT;
             rootString = ((ObjEntity) root).getName();
         }
         else if (root instanceof DbEntity) {
-            rootType = QueryLoader.DB_ENTITY_ROOT;
+            rootType = MapLoader.DB_ENTITY_ROOT;
             rootString = ((DbEntity) root).getName();
         }
         else if (root instanceof Procedure) {
-            rootType = QueryLoader.PROCEDURE_ROOT;
+            rootType = MapLoader.PROCEDURE_ROOT;
             rootString = ((Procedure) root).getName();
         }
         else if (root instanceof Class) {
-            rootType = QueryLoader.JAVA_CLASS_ROOT;
+            rootType = MapLoader.JAVA_CLASS_ROOT;
             rootString = ((Class<?>) root).getName();
         }
         else if (root instanceof DataMap) {
-            rootType = QueryLoader.DATA_MAP_ROOT;
+            rootType = MapLoader.DATA_MAP_ROOT;
             rootString = ((DataMap) root).getName();
         }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java?rev=606433&r1=606432&r2=606433&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
Sat Dec 22 01:26:13 2007
@@ -28,9 +28,9 @@
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.EntityResolver;
+import org.apache.cayenne.map.MapLoader;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.Procedure;
-import org.apache.cayenne.map.QueryLoader;
 import org.apache.cayenne.util.Util;
 import org.apache.cayenne.util.XMLEncoder;
 import org.apache.cayenne.util.XMLSerializable;
@@ -222,23 +222,23 @@
         String rootType = null;
 
         if (root instanceof String) {
-            rootType = QueryLoader.OBJ_ENTITY_ROOT;
+            rootType = MapLoader.OBJ_ENTITY_ROOT;
             rootString = root.toString();
         }
         else if (root instanceof ObjEntity) {
-            rootType = QueryLoader.OBJ_ENTITY_ROOT;
+            rootType = MapLoader.OBJ_ENTITY_ROOT;
             rootString = ((ObjEntity) root).getName();
         }
         else if (root instanceof DbEntity) {
-            rootType = QueryLoader.DB_ENTITY_ROOT;
+            rootType = MapLoader.DB_ENTITY_ROOT;
             rootString = ((DbEntity) root).getName();
         }
         else if (root instanceof Procedure) {
-            rootType = QueryLoader.PROCEDURE_ROOT;
+            rootType = MapLoader.PROCEDURE_ROOT;
             rootString = ((Procedure) root).getName();
         }
         else if (root instanceof Class) {
-            rootType = QueryLoader.JAVA_CLASS_ROOT;
+            rootType = MapLoader.JAVA_CLASS_ROOT;
             rootString = ((Class<?>) root).getName();
         }
 

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/QueryLoaderTest.java
(from r606426, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/QueryBuilderTest.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/QueryLoaderTest.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/QueryLoaderTest.java&p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/QueryBuilderTest.java&r1=606426&r2=606433&rev=606433&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/QueryBuilderTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/QueryLoaderTest.java
Sat Dec 22 01:26:13 2007
@@ -25,7 +25,7 @@
 /**
  * @author Andrus Adamchik
  */
-public class QueryBuilderTest extends BasicCase {
+public class QueryLoaderTest extends BasicCase {
 
     protected QueryLoader builder;
 
@@ -48,7 +48,7 @@
         DbEntity entity = new DbEntity("DB1");
         map.addDbEntity(entity);
 
-        builder.setRoot(map, QueryLoader.DB_ENTITY_ROOT, "DB1");
+        builder.setRoot(map, MapLoader.DB_ENTITY_ROOT, "DB1");
         assertSame(entity, builder.getRoot());
     }
 
@@ -57,14 +57,14 @@
         ObjEntity entity = new ObjEntity("OBJ1");
         map.addObjEntity(entity);
 
-        builder.setRoot(map, QueryLoader.OBJ_ENTITY_ROOT, "OBJ1");
+        builder.setRoot(map, MapLoader.OBJ_ENTITY_ROOT, "OBJ1");
         assertSame(entity, builder.getRoot());
     }
 
     public void testSetRootDataMap() throws Exception {
         DataMap map = new DataMap("map");
 
-        builder.setRoot(map, QueryLoader.DATA_MAP_ROOT, null);
+        builder.setRoot(map, MapLoader.DATA_MAP_ROOT, null);
         assertSame(map, builder.getRoot());
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/SQLTemplateBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/SQLTemplateBuilderTest.java?rev=606433&r1=606432&r2=606433&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/SQLTemplateBuilderTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/SQLTemplateBuilderTest.java
Sat Dec 22 01:26:13 2007
@@ -48,7 +48,7 @@
         map.addObjEntity(entity);
 
         SQLTemplateBuilder builder = new SQLTemplateBuilder();
-        builder.setRoot(map, QueryLoader.OBJ_ENTITY_ROOT, "A");
+        builder.setRoot(map, MapLoader.OBJ_ENTITY_ROOT, "A");
 
         Query query = builder.getQuery();
         assertTrue(query instanceof SQLTemplate);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/SelectQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/SelectQueryBuilderTest.java?rev=606433&r1=606432&r2=606433&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/SelectQueryBuilderTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/SelectQueryBuilderTest.java
Sat Dec 22 01:26:13 2007
@@ -49,7 +49,7 @@
         map.addObjEntity(entity);
 
         SelectQueryBuilder builder = new SelectQueryBuilder();
-        builder.setRoot(map, QueryLoader.OBJ_ENTITY_ROOT, "A");
+        builder.setRoot(map, MapLoader.OBJ_ENTITY_ROOT, "A");
 
         assertTrue(builder.getQuery() instanceof SelectQuery);
         assertSame(entity, ((SelectQuery) builder.getQuery()).getRoot());



Mime
View raw message