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:43:56 UTC
cvs commit: jakarta-turbine-torque/src/java/org/apache/torque/util Criteria.java
jmcnally 01/09/27 16:43:56
Modified: src/java/org/apache/torque/util Criteria.java
Log:
added hashCode method to Criteria.Criterion
submitted by Age Mooy
Revision Changes Path
1.4 +31 -1 jakarta-turbine-torque/src/java/org/apache/torque/util/Criteria.java
Index: Criteria.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/util/Criteria.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Criteria.java 2001/08/10 12:23:04 1.3
+++ Criteria.java 2001/09/27 23:43:56 1.4
@@ -90,7 +90,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.3 2001/08/10 12:23:04 knielsen Exp $
+ * @version $Id: Criteria.java,v 1.4 2001/09/27 23:43:56 jmcnally Exp $
*/
public class Criteria extends Hashtable
{
@@ -3647,6 +3647,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