db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpoes...@apache.org
Subject cvs commit: db-torque/src/java/org/apache/torque/util SqlExpression.java
Date Thu, 20 Mar 2003 20:34:42 GMT
mpoeschl    2003/03/20 12:34:42

  Modified:    src/java/org/apache/torque/util SqlExpression.java
  Log:
  replace StringStack with HashSet
  
  Revision  Changes    Path
  1.22      +10 -6     db-torque/src/java/org/apache/torque/util/SqlExpression.java
  
  Index: SqlExpression.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/java/org/apache/torque/util/SqlExpression.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- SqlExpression.java	18 Jan 2003 16:39:51 -0000	1.21
  +++ SqlExpression.java	20 Mar 2003 20:34:42 -0000	1.22
  @@ -3,7 +3,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -56,14 +56,17 @@
   
   import java.lang.reflect.Array;
   import java.util.Date;
  +import java.util.HashSet;
   import java.util.Iterator;
   import java.util.List;
  +
  +import org.apache.commons.lang.StringUtils;
  +import org.apache.torque.TorqueException;
   import org.apache.torque.adapter.DB;
   import org.apache.torque.om.DateKey;
   import org.apache.torque.om.ObjectKey;
   import org.apache.torque.om.StringKey;
  -import org.apache.torque.TorqueException;
  -import org.apache.commons.collections.StringStack;
  +
   
   /**
    * This class represents a part of an SQL query found in the <code>WHERE</code>
  @@ -78,6 +81,7 @@
    * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
    * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
    * @author <a href="mailto:fedor@apache.org">Fedor Karpelevitch</a>
  + * @author <a href="mailto:mpoeschl@marmot.at">Martin Poeschl</a>
    * @version $Id$
    */
   public class SqlExpression
  @@ -506,7 +510,7 @@
           }
   
           whereClause.append(comparison);
  -        StringStack inClause = new StringStack();
  +        HashSet inClause = new HashSet();
           if (criteria instanceof List)
           {
               Iterator iter = ((List) criteria).iterator();
  @@ -532,7 +536,7 @@
               }
           }
           whereClause.append('(')
  -                   .append(inClause.toString(","))
  +                   .append(StringUtils.join(inClause.iterator(), ","))
                      .append(')');
       }
   
  
  
  

Mime
View raw message