cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From and...@apache.org
Subject svn commit: r785665 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans: QueryAssembler.java SelectTranslator.java
Date Wed, 17 Jun 2009 15:24:55 GMT
Author: andrey
Date: Wed Jun 17 15:24:54 2009
New Revision: 785665

URL: http://svn.apache.org/viewvc?rev=785665&view=rev
Log:
CAY-1235 Implement qualifiers for DBEntities. Fixing parameter order

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssembler.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssembler.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssembler.java?rev=785665&r1=785664&r2=785665&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssembler.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssembler.java
Wed Jun 17 15:24:54 2009
@@ -57,6 +57,11 @@
      * PreparedStatement attributes matching entries in <code>values</code> list.
      */
     protected List<DbAttribute> attributes = new ArrayList<DbAttribute>();
+    
+    /**
+     * The index parameter will be inserted at in parameter list
+     */
+    protected int parameterIndex;
 
     /**
      * Returns aliases for the path splits defined in the query.
@@ -177,8 +182,8 @@
      * @param dbAttr DbAttribute being processed.
      */
     public void addToParamList(DbAttribute dbAttr, Object anObject) {
-        attributes.add(dbAttr);
-        values.add(anObject);
+        attributes.add(parameterIndex, dbAttr);
+        values.add(parameterIndex++, anObject);
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java?rev=785665&r1=785664&r2=785665&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
Wed Jun 17 15:24:54 2009
@@ -187,6 +187,9 @@
 
         // append tables and joins
         joins.appendRootWithQuoteSqlIdentifiers(queryBuf, getRootDbEntity());
+        
+        //join parameters will be added to head of query
+        parameterIndex = 0;
 
         joins.appendJoins(queryBuf);
         joins.appendQualifier(qualifierBuffer, qualifierBuffer.length() == 0);



Mime
View raw message