You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jm...@apache.org on 2001/09/28 01:45:35 UTC

cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/util/db Criteria.java

jmcnally    01/09/27 16:45:35

  Modified:    src/java/org/apache/turbine/util/db Criteria.java
  Log:
  added hashCode() to Criteria.Criterion
  submitted by Age Mooy
  
  Revision  Changes    Path
  1.2       +31 -1     jakarta-turbine-2/src/java/org/apache/turbine/util/db/Criteria.java
  
  Index: Criteria.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/util/db/Criteria.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Criteria.java	2001/08/16 05:09:46	1.1
  +++ Criteria.java	2001/09/27 23:45:35	1.2
  @@ -91,7 +91,7 @@
    * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
    * @author <a href="mailto:eric@dobbse.net">Eric Dobbs</a>
    * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
  - * @version $Id: Criteria.java,v 1.1 2001/08/16 05:09:46 jvanzyl Exp $
  + * @version $Id: Criteria.java,v 1.2 2001/09/27 23:45:35 jmcnally Exp $
    */
   public class Criteria extends Hashtable
   {
  @@ -3648,6 +3648,36 @@
                   || (or != null && or.equals(crit.getOr()));
   
               return isEquiv;
  +        }
  +
  +        /**
  +         * Returns a hash code value for the object.
  +         */
  +        public int hashCode()
  +        {
  +            int h = value.hashCode() ^ comparison.hashCode();
  +
  +            if (table != null)
  +            {
  +                h ^= table.hashCode();
  +            }
  +
  +            if (column != null)
  +            {
  +                h ^= column.hashCode();
  +            }
  +
  +            if (and != null)
  +            {
  +                h ^= and.hashCode();
  +            }
  +
  +            if (or != null)
  +            {
  +                h ^= or.hashCode();
  +            }
  +
  +            return h;
           }
   
           public String[] getAllTables()
  
  
  

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