db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql SqlQueryStatement.java
Date Sat, 04 Sep 2004 17:01:37 GMT
brj         2004/09/04 10:01:37

  Modified:    src/java/org/apache/ojb/broker/accesslayer/sql Tag:
                        OJB_1_0_RELEASE SqlQueryStatement.java
  Log:
  fixed problem with empty collection
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.75.2.3  +8 -5      db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java
  
  Index: SqlQueryStatement.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java,v
  retrieving revision 1.75.2.2
  retrieving revision 1.75.2.3
  diff -u -r1.75.2.2 -r1.75.2.3
  --- SqlQueryStatement.java	28 Jul 2004 18:03:28 -0000	1.75.2.2
  +++ SqlQueryStatement.java	4 Sep 2004 17:01:36 -0000	1.75.2.3
  @@ -754,12 +754,15 @@
               int size = ((Collection) c.getValue()).size();
   
               buf.append("(");
  -            for (int i = 0; i < size - 1; i++)
  +            if (size > 0)
               {
  -                appendParameter(values[i], buf);
  -                buf.append(",");
  +                for (int i = 0; i < size - 1; i++)
  +                {
  +                    appendParameter(values[i], buf);
  +                    buf.append(",");
  +                }
  +                appendParameter(values[size - 1], buf);
               }
  -            appendParameter(values[size - 1], buf);
               buf.append(")");
           }
           else
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message