db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1224848 [1/4] - in /db/torque/torque4/trunk/torque-runtime/src: main/java/org/apache/torque/criteria/ main/java/org/apache/torque/map/ main/java/org/apache/torque/sql/ main/java/org/apache/torque/util/ test/java/org/apache/torque/criteria/...
Date Tue, 27 Dec 2011 01:17:12 GMT
Author: tfischer
Date: Tue Dec 27 01:17:11 2011
New Revision: 1224848

URL: http://svn.apache.org/viewvc?rev=1224848&view=rev
Log:
TORQUE-178: 
- Add new criteria package
- move SqlEnum and Criteria.Join to new package
- Create new Criteria and Criterion classes in the new package
- Create deprecated CriteriaInterface in the new package

Added:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/CriteriaInterface.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criterion.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Join.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/SqlEnum.java
      - copied, changed from r1206840, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SqlEnum.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/package.html
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/MapHelper.java
    db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/
    db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriteriaTest.java
    db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java
    db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/sql/SqlBuilderTestOldCriteria.java
Removed:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SqlEnum.java
Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/JoinBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/OrderBy.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/Query.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/WhereClauseExpression.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeer.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/CountHelper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java
    db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/sql/SqlBuilderTest.java
    db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/util/CriteriaTest.java

Added: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java?rev=1224848&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java (added)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java Tue Dec 27 01:17:11 2011
@@ -0,0 +1,2400 @@
+package org.apache.torque.criteria;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.torque.Column;
+import org.apache.torque.ColumnImpl;
+import org.apache.torque.Torque;
+import org.apache.torque.sql.OrderBy;
+import org.apache.torque.sql.Query;
+import org.apache.torque.sql.SqlBuilder;
+import org.apache.torque.util.UniqueColumnList;
+import org.apache.torque.util.UniqueList;
+
+/**
+ * Encapsulates conditions to access rows in database tables.
+ *
+ * @author <a href="mailto:frank.kim@clearink.com">Frank Y. Kim</a>
+ * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
+ * @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>
+ * @author <a href="mailto:sam@neurogrid.com">Sam Joseph</a>
+ * @author <a href="mailto:mpoeschl@marmot.at">Martin Poeschl</a>
+ * @author <a href="mailto:fischer@seitenbau.de">Thomas Fischer</a>
+ * @author <a href="mailto:seade@backstagetech.com.au">Scott Eade</a>
+ * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
+ * @version $Id: Criteria.java 1211142 2011-12-06 21:04:03Z tfischer $
+ */
+public class Criteria implements Serializable, CriteriaInterface
+{
+    /** Serial version. */
+    private static final long serialVersionUID = -9001666575933085601L;
+
+    /** Comparison type. */
+    public static final SqlEnum EQUAL = SqlEnum.EQUAL;
+
+    /** Comparison type. */
+    public static final SqlEnum NOT_EQUAL = SqlEnum.NOT_EQUAL;
+
+    /** Comparison type. */
+    public static final SqlEnum ALT_NOT_EQUAL = SqlEnum.ALT_NOT_EQUAL;
+
+    /** Comparison type. */
+    public static final SqlEnum GREATER_THAN = SqlEnum.GREATER_THAN;
+
+    /** Comparison type. */
+    public static final SqlEnum LESS_THAN = SqlEnum.LESS_THAN;
+
+    /** Comparison type. */
+    public static final SqlEnum GREATER_EQUAL = SqlEnum.GREATER_EQUAL;
+
+    /** Comparison type. */
+    public static final SqlEnum LESS_EQUAL = SqlEnum.LESS_EQUAL;
+
+    /** Comparison type. */
+    public static final SqlEnum LIKE = SqlEnum.LIKE;
+
+    /** Comparison type. */
+    public static final SqlEnum NOT_LIKE = SqlEnum.NOT_LIKE;
+
+    /** Comparison type. */
+    public static final SqlEnum ILIKE = SqlEnum.ILIKE;
+
+    /** Comparison type. */
+    public static final SqlEnum NOT_ILIKE = SqlEnum.NOT_ILIKE;
+
+    /** Comparison type. */
+    public static final SqlEnum CUSTOM = SqlEnum.CUSTOM;
+
+    /** Comparison type. */
+    public static final SqlEnum DISTINCT = SqlEnum.DISTINCT;
+
+    /** Comparison type. */
+    public static final SqlEnum IN = SqlEnum.IN;
+
+    /** Comparison type. */
+    public static final SqlEnum NOT_IN = SqlEnum.NOT_IN;
+
+    /** Comparison type. */
+    public static final SqlEnum ALL = SqlEnum.ALL;
+
+    /** Comparison type. */
+    public static final SqlEnum JOIN = SqlEnum.JOIN;
+
+    /** &quot;IS NULL&quot; null comparison */
+    public static final SqlEnum ISNULL = SqlEnum.ISNULL;
+
+    /** &quot;IS NOT NULL&quot; null comparison */
+    public static final SqlEnum ISNOTNULL = SqlEnum.ISNOTNULL;
+
+    /** &quot;CURRENT_DATE&quot; ANSI SQL function */
+    public static final SqlEnum CURRENT_DATE = SqlEnum.CURRENT_DATE;
+
+    /** &quot;CURRENT_TIME&quot; ANSI SQL function */
+    public static final SqlEnum CURRENT_TIME = SqlEnum.CURRENT_TIME;
+
+    /** &quot;LEFT JOIN&quot; SQL statement */
+    public static final SqlEnum LEFT_JOIN = SqlEnum.LEFT_JOIN;
+
+    /** &quot;RIGHT JOIN&quot; SQL statement */
+    public static final SqlEnum RIGHT_JOIN = SqlEnum.RIGHT_JOIN;
+
+    /** &quot;INNER JOIN&quot; SQL statement */
+    public static final SqlEnum INNER_JOIN = SqlEnum.INNER_JOIN;
+
+    /** Whether to ignore the case in all String conditions in the criteria. */
+    private boolean ignoreCase = false;
+
+    /** Whether the result must be a single record. */
+    private boolean singleRecord = false;
+
+    /** List of modifiers like DISTICT. */
+    private UniqueList<String> selectModifiers = new UniqueList<String>();
+
+    /** List of all columns to select. */
+    private UniqueColumnList selectColumns = new UniqueColumnList();
+
+    /** All "order by" clauses, containing the order ASC or DESC. */
+    private UniqueList<OrderBy> orderByColumns = new UniqueList<OrderBy>();
+
+    /** The names of columns to add to a groupBy clause */
+    private UniqueColumnList groupByColumns = new UniqueColumnList();
+
+    /** The having clause in a query. */
+    private Criterion having = null;
+
+    /** The criterion objects, keyed by the column. */
+    private Criterion topLevelCriterion;
+
+    /**
+     * Maps column alias names to the real column names.
+     * The key of the map is the alias and the value is the real column.
+     */
+    private Map<String, Column> asColumns
+            = new LinkedHashMap<String, Column>();
+
+    /** Contains all joins. */
+    private List<Join> joins = new ArrayList<Join>();
+
+    /** The name of the database in which this criteria should execute. */
+    private String dbName;
+
+    /**
+     * To limit the number of rows to return.  <code>-1</code> means return all
+     * rows.
+     */
+    private int limit = -1;
+
+    /** To start the results at a row other than the first one. */
+    private int offset = 0;
+
+    /**
+     * Aliases for table names. The key of the map is the alias,
+     * and the value is the real name of the table.
+     */
+    private Map<String, String> aliases = new HashMap<String, String>();
+
+    private boolean useTransaction = false;
+
+    /**
+     * Creates a new instance with the default capacity.
+     */
+    public Criteria()
+    {
+        this(Torque.getDefaultDB());
+    }
+
+    /**
+     * Creates a new instance with the default capacity which corresponds to
+     * the specified database.
+     *
+     * @param dbName The database name.
+     */
+    public Criteria(String dbName)
+    {
+        this.dbName = dbName;
+    }
+
+    /**
+     * Add an AS clause to the select columns. Usage:
+     * <p>
+     * <code>
+     * Criteria myCrit = new Criteria();
+     * myCrit.addAsColumn(
+     *     &quot;alias&quot;,
+     *     &quot;ALIAS(&quot;+MyPeer.ID+&quot;)&quot;);
+     * </code>
+     * If the name already exists, it is replaced by the new clause.
+     *
+     * @param name wanted Name of the column
+     * @param clause SQL clause to select from the table
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addAsColumn(String name, Column clause)
+    {
+        asColumns.put(name, clause);
+        return this;
+    }
+
+   /**
+    * Add an AS clause to the select columns. Usage:
+    * <p>
+    * <code>
+    * Criteria myCrit = new Criteria();
+    * myCrit.addAsColumn(
+    *     &quot;alias&quot;,
+    *     &quot;ALIAS(&quot;+MyPeer.ID+&quot;)&quot;);
+    * </code>
+    * If the name already exists, it is replaced by the new clause.
+    *
+    * @param name wanted Name of the column
+    * @param clause SQL clause to select from the table
+    *
+    * @return A modified Criteria object.
+    */
+    public Criteria addAsColumn(String name, String clause)
+    {
+        asColumns.put(name, new ColumnImpl(clause));
+        return this;
+    }
+
+    /**
+     * Get the column aliases.
+     *
+     * @return A Map which map the column alias names
+     * to the alias clauses.
+     */
+    public Map<String, Column> getAsColumns()
+    {
+        return asColumns;
+    }
+
+    /**
+     * Get the table aliases.
+     *
+     * @return A Map which maps the table alias names to the actual table names.
+     */
+    public Map<String, String> getAliases()
+    {
+        return aliases;
+    }
+
+    /**
+     * Allows one to specify an alias for a table.
+     *
+     * @param alias the alias for the table name.
+     * @param table the table name as known in the database.
+     */
+    public void addAlias(String alias, String table)
+    {
+        aliases.put(alias, table);
+    }
+
+    /**
+     * Returns the table name associated with an alias.
+     *
+     * @param alias a <code>String</code> value
+     * @return a <code>String</code> value
+     */
+    public String getTableForAlias(String alias)
+    {
+        return aliases.get(alias);
+    }
+
+    /**
+     * Will force the sql represented by this criteria to be executed within
+     * a transaction.  This is here primarily to support the oid type in
+     * postgresql.  Though it can be used to require any single sql statement
+     * to use a transaction.
+     */
+    public void setUseTransaction(boolean v)
+    {
+        useTransaction = v;
+    }
+
+    /**
+     * called by BasePeer to determine whether the sql command specified by
+     * this criteria must be wrapped in a transaction.
+     *
+     * @return a <code>boolean</code> value
+     */
+    protected boolean isUseTransaction()
+    {
+        return useTransaction;
+    }
+
+    /**
+     * Returns the top level Criterion.
+     *
+     * @return the top level Criterion, or null if no Criterion is contained.
+     */
+    public Criterion getTopLevelCriterion()
+    {
+        return topLevelCriterion;
+    }
+
+    /**
+     * Method to return a criterion that is not added automatically
+     * to this Criteria.  This can be used to chain the
+     * Criterions to form a more complex where clause.
+     *
+     * @param column full name of column (for example TABLE.COLUMN).
+     * @param value The value to compare to.
+     * @param comparison the comparison to use.
+     *
+     * @return A Criterion.
+     *
+     * @deprecated use the constructor Criterion(Column, Object, SqlEnum)
+     *             instead.
+     */
+    public Criterion getNewCriterion(String column, Object value,
+            SqlEnum comparison)
+    {
+        return new Criterion(new ColumnImpl(column), value, comparison);
+    }
+
+    /**
+     * Method to return criterion that is not added automatically
+     * to this Criteria.  This can be used to chain the
+     * Criterions to form a more complex where clause.
+     *
+     * @param column a column (for example TablePeer.COLUMN).
+     * @param value The value to compare to.
+     * @param comparison the comparison to use.
+     *
+     * @return A Criterion.
+     *
+     * @deprecated use the constructor Criterion(Column, Object, SqlEnum)
+     *             instead.
+     */
+    public Criterion getNewCriterion(Column column, Object value,
+            SqlEnum comparison)
+    {
+        return new Criterion(column, value, comparison);
+    }
+
+    /**
+     * Get the Database name to be used for this criterion.
+     *
+     * @return The database name, not null.
+     */
+    public String getDbName()
+    {
+        return dbName;
+    }
+
+    /**
+     * Set the Database name.  If <code>null</code> is supplied, uses value
+     * provided by <code>Torque.getDefaultDB()</code>.
+     *
+     * @param dbName The Database(Map) name.
+     */
+    public void setDbName(String dbName)
+    {
+        this.dbName = (dbName == null ? Torque.getDefaultDB() : dbName.trim());
+    }
+
+    /**
+     * This method adds a prepared Criterion object to the Criteria as a having
+     * clause. Usage:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria();
+     * Criterion c =new Criterion(MyPeer.ID, 5, Criteria.LESS_THAN);
+     * crit.addHaving(c);
+     * </code>
+     *
+     * @param having A Criterion object
+     * @return A modified Criteria object.
+     */
+    public Criteria addHaving(Criterion having)
+    {
+        this.having = having;
+        return this;
+    }
+
+    /**
+     * Get Having Criterion.
+     *
+     * @return A Criterion that is the having clause.
+     */
+    public Criterion getHaving()
+    {
+        return having;
+    }
+
+    /**
+     * Adds a join to the criteria, E.g. to create the condition
+     * <p>
+     * AND PROJECT.PROJECT_ID=FOO.PROJECT_ID
+     * <p> use <p>
+     * <code>
+     * criteria.addJoin(ProjectPeer.PROJECT_ID, FooPeer.PROJECT_ID)
+     * </code>
+     *
+     * @param left A String with the left side of the join.
+     * @param right A String with the right side of the join.
+     * @return A modified Criteria object.
+     */
+    public Criteria addJoin(Column left, Column right)
+    {
+        return addJoin(left, right, null);
+    }
+
+    /**
+     * Adds a join to the criteria, E.g. to create the condition
+     * <p>
+     * PROJECT LEFT JOIN FOO ON PROJECT.PROJECT_ID=FOO.PROJECT_ID
+     * <p> use <p>
+     * <code>
+     * criteria.addJoin(ProjectPeer.PROJECT_ID, FooPeer.PROJECT_ID,
+     *     Criteria.LEFT_JOIN);
+     * </code>
+     *
+     * @param left A String with the left side of the join.
+     * @param right A String with the right side of the join.
+     * @param operator The operator used for the join: must be one of null,
+     *        Criteria.LEFT_JOIN, Criteria.RIGHT_JOIN, Criteria.INNER_JOIN
+     * @return A modified Criteria object.
+     */
+    public Criteria addJoin(Column left, Column right, SqlEnum operator)
+    {
+        joins.add(new Join(left, right, operator));
+
+        return this;
+    }
+
+    /**
+     * Adds a join to the criteria, E.g. to create the condition
+     * <p>
+     * AND PROJECT.PROJECT_ID=FOO.PROJECT_ID
+     * <p> use <p>
+     * <code>
+     * criteria.addJoin("PROJECT.PROJECT_ID", "FOO.PROJECT_ID")
+     * </code>
+     *
+     * @param left A String with the left side of the join.
+     * @param right A String with the right side of the join.
+     * @return A modified Criteria object.
+     */
+    public Criteria addJoin(String left, String right)
+    {
+        return addJoin(left, right, null);
+    }
+
+    /**
+     * Adds a join to the criteria, E.g. to create the condition
+     * <p>
+     * PROJECT LEFT JOIN FOO ON PROJECT.PROJECT_ID=FOO.PROJECT_ID
+     * <p> use <p>
+     * <code>
+     * criteria.addJoin("PROJECT.PROJECT_ID", "FOO.PROJECT_ID",
+     *     Criteria.LEFT_JOIN);
+     * </code>
+     *
+     * @param left A String with the left side of the join.
+     * @param right A String with the right side of the join.
+     * @param operator The operator used for the join: must be one of null,
+     *        Criteria.LEFT_JOIN, Criteria.RIGHT_JOIN, Criteria.INNER_JOIN
+     * @return A modified Criteria object.
+     */
+    public Criteria addJoin(String left, String right, SqlEnum operator)
+    {
+        joins.add(new Join(
+                new ColumnImpl(left),
+                new ColumnImpl(right),
+                operator));
+
+        return this;
+    }
+
+    /**
+     * Get the List of Joins.
+     *
+     * @return a List which contains objects of type Join, not null.
+     */
+    public List<Join> getJoins()
+    {
+        return joins;
+    }
+
+    /**
+     * Adds &quot;ALL &quot; to the SQL statement.
+     */
+    public void setAll()
+    {
+        selectModifiers.add(ALL.toString());
+    }
+
+    /**
+     * Adds &quot;DISTINCT &quot; to the SQL statement.
+     */
+    public void setDistinct()
+    {
+        selectModifiers.add(DISTINCT.toString());
+    }
+
+    /**
+     * Sets whether case should be ignored in where clauses and order by
+     * whenever String columns are encountered.
+     *
+     * @param ignoreCase True if case should be ignored.
+     * @return A modified Criteria object.
+     */
+    public Criteria setIgnoreCase(boolean ignoreCase)
+    {
+        this.ignoreCase = ignoreCase;
+        return this;
+    }
+
+    /**
+     * Returns whether case should be ignored in where clauses and order by
+     * whenever String columns are encountered.
+     *
+     * @return True if case is ignored.
+     */
+    public boolean isIgnoreCase()
+    {
+        return ignoreCase;
+    }
+
+    /**
+     * Switch the check on or off that a query returns exactly one record.
+     * Set this to <code>true</code> if you want a TorqueException to be thrown
+     * if none or multiple records are returned when the query is executed.
+     * This should be used in situations where returning multiple
+     * rows would indicate an error of some sort.  If your query might return
+     * multiple records but you are only interested in the first one then you
+     * should be using setLimit(1).
+     *
+     * @param b set to <code>true</code> if you expect the query to select
+     *        exactly one record.
+     * @return A modified Criteria object.
+     */
+    public Criteria setSingleRecord(boolean b)
+    {
+        singleRecord = b;
+        return this;
+    }
+
+    /**
+     * Returns whether the check that a query returns exactly one record
+     * is active.
+     *
+     * @return True if the check for exactly one record is active.
+     */
+    public boolean isSingleRecord()
+    {
+        return singleRecord;
+    }
+
+    /**
+     * Set a limit for the query
+     *
+     * @param limit The upper limit for the number of records returned
+     *        by a query.
+     * @return A modified Criteria object.
+     */
+    public Criteria setLimit(int limit)
+    {
+        this.limit = limit;
+        return this;
+    }
+
+    /**
+     * Get the upper limit for the number of records returned by a query.
+     *
+     * @return The value for limit.
+     */
+    public int getLimit()
+    {
+        return limit;
+    }
+
+    /**
+     * Set the offset.
+     *
+     * @param offset how many records should be skipped at the start of the
+     *        result.
+     * @return A modified Criteria object.
+     */
+    public Criteria setOffset(int offset)
+    {
+        this.offset = offset;
+        return this;
+    }
+
+    /**
+     * Get how many records should be skipped at the start of the result.
+     *
+     * @return The value for offset.
+     */
+    public int getOffset()
+    {
+        return offset;
+    }
+
+    /**
+     * Adds a select column to the Criteria.
+     *
+     * @param column The select column to add.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addSelectColumn(Column column)
+    {
+        selectColumns.add(column);
+        return this;
+    }
+
+    /**
+     * Adds a select column.
+     *
+     * @param column The name of the select column, possibly prefixed
+     *        by the table name.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addSelectColumn(String column)
+    {
+        selectColumns.add(new ColumnImpl(column));
+        return this;
+    }
+
+    /**
+     * Return all select columns.
+     *
+     * @return An List with the names of the select columns, not null
+     */
+    public UniqueColumnList getSelectColumns()
+    {
+        return selectColumns;
+    }
+
+    /**
+     * Return all select modifiers.
+     *
+     * @return An UniqueList with the select modifiers.
+     */
+    public UniqueList<String> getSelectModifiers()
+    {
+        return selectModifiers;
+    }
+
+    /**
+     * Add a group by clause.
+     *
+     * @param groupBy The column to group by.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addGroupByColumn(Column groupBy)
+    {
+        groupByColumns.add(groupBy);
+        return this;
+    }
+
+    /**
+     * Add a group by clause.
+     *
+     * @param groupBy The name of the column to group by.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addGroupByColumn(String groupBy)
+    {
+        groupByColumns.add(new ColumnImpl(groupBy));
+        return this;
+    }
+
+    /**
+     * Get all group by columns.
+     *
+     * @return An UniqueList with the name of the groupBy clause, not null.
+     */
+    public UniqueColumnList getGroupByColumns()
+    {
+        return groupByColumns;
+    }
+
+    /**
+     * Adds an order by clause, explicitly specifying ascending.
+     *
+     * @param column The column to order by.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addAscendingOrderByColumn(Column column)
+    {
+        orderByColumns.add(new OrderBy(column, SqlEnum.ASC, false));
+        return this;
+    }
+
+    /**
+     * Add order by column name, explicitly specifying ascending.
+     *
+     * @param column The name of the column to order by.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addAscendingOrderByColumn(String column)
+    {
+        orderByColumns.add(
+                new OrderBy(new ColumnImpl(column), SqlEnum.ASC, false));
+        return this;
+    }
+
+    /**
+     * Add an order by clause, explicitly specifying ascending.
+     *
+     * @param column The column to order by.
+     * @param ignoreCase whether to ignore case on String columns.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addAscendingOrderByColumn(Column column, boolean ignoreCase)
+    {
+        orderByColumns.add(new OrderBy(column, SqlEnum.ASC, ignoreCase));
+        return this;
+    }
+
+    /**
+     * Add order by column name, explicitly specifying ascending.
+     *
+     * @param column The name of the column to order by.
+     * @param ignoreCase whether to ignore case on String columns.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addAscendingOrderByColumn(String column, boolean ignoreCase)
+    {
+        orderByColumns.add(
+                new OrderBy(new ColumnImpl(column), SqlEnum.ASC, ignoreCase));
+        return this;
+    }
+
+    /**
+     * Add order by column name, explicitly specifying descending.
+     *
+     * @param column The column to order by.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addDescendingOrderByColumn(Column column)
+    {
+        orderByColumns.add(new OrderBy(column, SqlEnum.DESC, false));
+        return this;
+    }
+
+    /**
+     * Add order by column name, explicitly specifying descending.
+     *
+     * @param column The name of the column to order by.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addDescendingOrderByColumn(String column)
+    {
+        orderByColumns.add(
+                new OrderBy(new ColumnImpl(column), SqlEnum.DESC, false));
+        return this;
+    }
+
+    /**
+     * Add order by column name, explicitly specifying descending.
+     *
+     * @param column The column to order by.
+     *
+     * @param ignoreCase whether to ignore case on String columns.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addDescendingOrderByColumn(
+            Column column,
+            boolean ignoreCase)
+    {
+        orderByColumns.add(new OrderBy(column, SqlEnum.DESC, ignoreCase));
+        return this;
+    }
+
+    /**
+     * Add order by column name, explicitly specifying descending.
+     *
+     * @param column The name of the column to order by.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria addDescendingOrderByColumn(
+            String column,
+            boolean ignoreCase)
+    {
+        orderByColumns.add(
+                new OrderBy(new ColumnImpl(column), SqlEnum.DESC, ignoreCase));
+        return this;
+    }
+
+    /**
+     * Get all order by columns.
+     *
+     * @return An UniqueList with the name of the order columns, not null.
+     */
+    public UniqueList<OrderBy> getOrderByColumns()
+    {
+        return orderByColumns;
+    }
+
+    /**
+     * Build a string representation of the Criteria for debugging purposes.
+     *
+     * @return A String with the representation of the Criteria.
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder("Criteria: ");
+        try
+        {
+            Query query = SqlBuilder.buildQuery(this);
+            sb.append("Current Query SQL (may not be complete or applicable): ")
+                    .append(query.getDisplayString());
+        }
+        catch (Exception exc)
+        {
+            sb.append("Error" + exc.getMessage());
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * Checks whether an object is equal to this Criteria.
+     * This is the case if the other object is also a Criteria and has
+     * the same attributes and criterions.
+     *
+     * @param object the other object to check, can be null.
+     *
+     * @return true if the object is equal to this Criteria, false otherwise.
+     */
+    @Override
+    public boolean equals(Object object)
+    {
+        if (object == null)
+        {
+            return false;
+        }
+        if (this == object)
+        {
+            return true;
+        }
+        if (object.getClass() != this.getClass())
+        {
+            return false;
+        }
+        Criteria criteria = (Criteria) object;
+        EqualsBuilder equalsBuilder = new EqualsBuilder();
+        equalsBuilder.append(
+                criteria.topLevelCriterion,
+                this.topLevelCriterion);
+        equalsBuilder.append(criteria.offset, this.offset);
+        equalsBuilder.append(criteria.limit, this.limit);
+        equalsBuilder.append(criteria.ignoreCase, this.ignoreCase);
+        equalsBuilder.append(criteria.singleRecord, this.singleRecord);
+        equalsBuilder.append(criteria.dbName, this.dbName);
+        equalsBuilder.append(criteria.selectModifiers, this.selectModifiers);
+        equalsBuilder.append(criteria.selectColumns, this.selectColumns);
+        equalsBuilder.append(criteria.orderByColumns, this.orderByColumns);
+        equalsBuilder.append(criteria.aliases, this.aliases);
+        equalsBuilder.append(criteria.asColumns, this.asColumns);
+        equalsBuilder.append(criteria.joins, this.joins);
+        return equalsBuilder.isEquals();
+    }
+
+    /**
+     * Returns the hash code value for this Criteria.
+     *
+     * @return a hash code value for this object.
+     */
+    public int hashCode()
+    {
+        HashCodeBuilder hashCodeBuilder = new HashCodeBuilder();
+        hashCodeBuilder.append(topLevelCriterion);
+        hashCodeBuilder.append(offset);
+        hashCodeBuilder.append(limit);
+        hashCodeBuilder.append(ignoreCase);
+        hashCodeBuilder.append(singleRecord);
+        hashCodeBuilder.append(dbName);
+        hashCodeBuilder.append(selectModifiers);
+        hashCodeBuilder.append(selectColumns);
+        hashCodeBuilder.append(orderByColumns);
+        hashCodeBuilder.append(aliases);
+        hashCodeBuilder.append(asColumns);
+        hashCodeBuilder.append(joins);
+        return hashCodeBuilder.toHashCode();
+    }
+
+   /*
+    * ------------------------------------------------------------------------
+    *
+    * Start of the deprecated "add" methods
+    *
+    * ------------------------------------------------------------------------
+    */
+
+    /**
+     * This method ands a Criterion object with the conditions
+     * in this Criteria. This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria();
+     * Criterion c = new Criterion(
+     *     BasePeer.ID, new Integer(5), Criteria.LESS_THAN);
+     * crit.add(c);
+     * </code>
+     *
+     * @param c A Criterion object
+     *
+     * @return A modified Criteria object.
+     *
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria add(Criterion c)
+    {
+        if (topLevelCriterion == null)
+        {
+            topLevelCriterion = c;
+        }
+        else
+        {
+            topLevelCriterion.and(c);
+        }
+        return this;
+    }
+
+    /**
+     * This method ands the given condition with the current conditions
+     * in the Criteria. It is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().add(&quot;column&quot;,
+     *                                      &quot;value&quot;);
+     * </code>
+     * An EQUAL comparison is used for column and value.
+     *
+     * @param column The column to run the comparison on.
+     * @param value The value to compare with the column, may be null.
+     *
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria add(Column column, Object value)
+    {
+        add(column, value, EQUAL);
+        return this;
+    }
+
+    /**
+     * This method ands the given condition with the current conditions
+     * in the Criteria. This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().add(&quot;column&quot;,
+     *                                      &quot;value&quot;);
+     * </code>
+     * An EQUAL comparison is used for column and value.
+     *
+     * @param column The column to run the comparison on.
+     * @param value The value to compare with the column, may be null.
+     *
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria add(String column, Object value)
+    {
+        add(column, value, EQUAL);
+        return this;
+    }
+
+    /**
+     * This method ands the given condition with the current conditions
+     * in the Criteria. It is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().add(&quot;column&quot;,
+     *                                      &quot;value&quot;
+     *                                      Criteria.GREATER_THAN);
+     * </code>
+     * Any comparison can be used.
+     *
+     * @param column The column to run the comparison on.
+     * @param value The value to compare with the column, may be null.
+     * @param comparison The comparison operator.
+     *
+     * @return A modified Criteria object.
+     *
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria add(Column column, Object value, SqlEnum comparison)
+    {
+        Criterion newCriterion = new Criterion(column, value, comparison);
+        if (topLevelCriterion == null)
+        {
+            topLevelCriterion = newCriterion;
+        }
+        else
+        {
+            topLevelCriterion.and(newCriterion);
+        }
+        return this;
+    }
+
+    /**
+     * This method ands the given condition with the current conditions
+     * in the Criteria. This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().add(&quot;column&quot;,
+     *                                      &quot;value&quot;
+     *                                      Criteria.GREATER_THAN);
+     * </code>
+     * Any comparison can be used.
+     *
+     * @param column The column to run the comparison on.
+     * @param value The value to compare with the column, may be null.
+     * @param comparison The comparison operator.
+     *
+     * @return A modified Criteria object.
+     *
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria add(String column, Object value, SqlEnum comparison)
+    {
+        Column columnImpl = new ColumnImpl(column);
+        Criterion newCriterion = new Criterion(columnImpl, value, comparison);
+        if (topLevelCriterion == null)
+        {
+            topLevelCriterion = newCriterion;
+        }
+        else
+        {
+            topLevelCriterion.and(newCriterion);
+        }
+        return this;
+    }
+
+    /**
+     * Convenience method to add a Date object specified by
+     * year, month, and date into the Criteria.  Equal to
+     * <p>
+     * <code>
+     * add(column, new GregorianCalendar(year, month, day), EQUAL);
+     * </code>
+     *
+     * @param column The column to compare the Date to.
+     * @param year An int with the year.
+     * @param month An int with the month. Month value is 0-based.
+     *        e.g., 0 for January
+     * @param day An int with the day.
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addDate(Column column, int year, int month, int day)
+    {
+        add(column, new GregorianCalendar(year, month, day).getTime());
+        return this;
+    }
+
+    /**
+     * Convenience method to add a Date object specified by
+     * year, month, and date into the Criteria. Equal to
+     * <p>
+     * <code>
+     * add(column, new GregorianCalendar(year, month, day), EQUAL);
+     * </code>
+     *
+     * @param column The name of the column to compare the date to.
+     * @param year An int with the year.
+     * @param month An int with the month. Month value is 0-based.
+     *        e.g., 0 for January
+     * @param day An int with the day.
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addDate(String column, int year, int month, int day)
+    {
+        add(column, new GregorianCalendar(year, month, day).getTime());
+        return this;
+    }
+
+    /**
+     * Convenience method to add a Date object specified by
+     * year, month, and date into the Criteria. Equal to
+     * <p>
+     * <code>
+     * add(column, new GregorianCalendar(year, month, day), comparison);
+     * </code>
+     *
+     * @param column The column to run the comparison on
+     * @param year An int with the year.
+     * @param month An int with the month. Month value is 0-based.
+     *        e.g., 0 for January
+     * @param day An int with the day.
+     * @param comparison String describing how to compare the column with
+     *        the value.
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addDate(Column column, int year, int month, int day,
+            SqlEnum comparison)
+    {
+        add(column, new GregorianCalendar(year, month, day).getTime(),
+                comparison);
+        return this;
+    }
+
+    /**
+     * Convenience method to add a Date object specified by
+     * year, month, and date into the Criteria.
+     * Equal to
+     *
+     * <p>
+     * <code>
+     * add(column, new GregorianCalendar(year, month, day), comparison);
+     * </code>
+     *
+     * @param column The column to run the comparison on
+     * @param year An int with the year.
+     * @param month An int with the month. Month value is 0-based.
+     *        e.g., 0 for January
+     * @param day An int with the day.
+     * @param comparison String describing how to compare the column with
+     *        the value
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addDate(String column, int year, int month, int day,
+            SqlEnum comparison)
+    {
+        add(column, new GregorianCalendar(year, month, day).getTime(),
+                comparison);
+        return this;
+    }
+
+    /**
+     * Adds an 'IN' clause with the value supplied as an Object
+     * array.  For example, to add the condition
+     * <p>
+     * FOO.NAME IN ('FOO', 'BAR', 'ZOW')
+     * <p> use <p>
+     * <code>
+     * criteria.addIn(FooPeer.NAME, new String[] {'FOO', 'BAR', 'ZOW'});
+     * </code>
+     *
+     * @param column The column to run the comparison on
+     * @param values An Object[] with the allowed values.
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addIn(Column column, Object[] values)
+    {
+        add(column, values, Criteria.IN);
+        return this;
+    }
+
+    /**
+     * Adds an 'IN' clause with the value supplied as an Object
+     * array.  For example, to add the condition
+     * <p>
+     * FOO.NAME IN ('FOO', 'BAR', 'ZOW')
+     * <p> use <p>
+     * <code>
+     * criteria.addIn("FOO.NAME", new String[] {'FOO', 'BAR', 'ZOW'});
+     * </code>
+     *
+     * @param column The column to run the comparison on
+     * @param values An Object[] with the allowed values.
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addIn(String column, Object[] values)
+    {
+        add(column, values, Criteria.IN);
+        return this;
+    }
+
+    /**
+    /**
+     * Adds an 'IN' clause with the criteria supplied as a Collection.
+     *  For example, to add the condition
+     * <p>
+     * FOO.NAME IN ('FOO', 'BAR', 'ZOW')
+     * <p> use <p>
+     * <code>
+     * criteria.addIn(FooPeer.NAME, values);
+     * </code>
+     *
+     * where 'values' contains three Strings "FOO", "BAR" and "ZOW".
+     *
+     * @param column The column to run the comparison on
+     * @param values A Collection with the allowed values.
+     *
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addIn(Column column, Collection<?> values)
+    {
+        add(column, values, Criteria.IN);
+        return this;
+    }
+
+    /**
+     * Adds an 'IN' clause with the criteria supplied as a Collection.
+     *  For example, to add the condition
+     * <p>
+     * FOO.NAME IN ('FOO', 'BAR', 'ZOW')
+     * <p> use <p>
+     * <code>
+     * criteria.addIn("FOO.NAME", values);
+     * </code>
+     *
+     * where 'values' contains three Strings "FOO", "BAR" and "ZOW".
+     *
+     * @param column The column to run the comparison on
+     * @param values A Collection with the allowed values.
+     *
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addIn(String column, Collection<?> values)
+    {
+        add(column, values, Criteria.IN);
+        return this;
+    }
+
+    /**
+     * Adds an 'NOT IN' clause with the value supplied as an Object
+     * array.  For example, to add the condition
+     * <p>
+     * FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
+     * <p> use <p>
+     * <code>
+     * criteria.addNotIn(FooPeer.NAME, new String[] {'FOO', 'BAR', 'ZOW'});
+     * </code>
+     *
+     * @param column The column to run the comparison on
+     * @param values An Object[] with the disallowed values.
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addNotIn(Column column, Object[] values)
+    {
+        add(column, values, Criteria.NOT_IN);
+        return this;
+    }
+
+    /**
+     * Adds an 'NOT IN' clause with the value supplied as an Object
+     * array.  For example, to add the condition
+     * <p>
+     * FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
+     * <p> use <p>
+     * <code>
+     * criteria.addNotIn("FOO.NAME", new String[] {'FOO', 'BAR', 'ZOW'});
+     * </code>
+     *
+     * @param column The column to run the comparison on
+     * @param values An Object[] with the disallowed values.
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addNotIn(String column, Object[] values)
+    {
+        add(column, values, Criteria.NOT_IN);
+        return this;
+    }
+
+    /**
+    /**
+     * Adds an 'NOT IN' clause with the criteria supplied as a Collection.
+     *  For example, to add the condition
+     * <p>
+     * FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
+     * <p> use <p>
+     * <code>
+     * criteria.addNotIn(FooPeer.NAME, values);
+     * </code>
+     *
+     * where 'values' contains three Strings "FOO", "BAR" and "ZOW".
+     *
+     * @param column The column to run the comparison on
+     * @param values A Collection with the disallowed values.
+     *
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addNotIn(Column column, Collection<?> values)
+    {
+        add(column, values, Criteria.NOT_IN);
+        return this;
+    }
+
+    /**
+     * Adds an 'NOT IN' clause with the criteria supplied as a Collection.
+     *  For example, to add the condition
+     * <p>
+     * FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
+     * <p> use <p>
+     * <code>
+     * criteria.addNotIn("FOO.NAME", values);
+     * </code>
+     *
+     * where 'values' contains three Strings "FOO", "BAR" and "ZOW".
+     *
+     * @param column The column to run the comparison on
+     * @param values A Collection with the allowed values.
+     *
+     * @return A modified Criteria object.
+     * @deprecated The semantics of this method has changed.
+     *             This method will be removed in a future version of Torque.
+     *             Use and(...) or where(...) instead.
+     */
+    public Criteria addNotIn(String column, Collection<?> values)
+    {
+        add(column, values, Criteria.NOT_IN);
+        return this;
+    }
+
+    /*
+     * ------------------------------------------------------------------------
+     *
+     * Start of the "and" methods
+     *
+     * ------------------------------------------------------------------------
+     */
+
+    /**
+     * "AND"s Criterion object with the conditions in this Criteria.
+     * This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria();
+     * Criterion c = new Criterion(BasePeer.ID, new Integer(5),
+     *         Criteria.LESS_THAN);
+     * crit.and(c);
+     * </code>
+     *
+     * @param criterion A Criterion object.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria and(Criterion criterion)
+    {
+        if (topLevelCriterion == null)
+        {
+            topLevelCriterion = criterion;
+        }
+        else
+        {
+            topLevelCriterion.and(criterion);
+        }
+        return this;
+    }
+
+    /**
+     * "AND"s a new condition with the conditions in this Criteria.
+     * This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().and(column, &quot;value&quot;);
+     * </code>
+     *
+     * An EQUAL comparison is used for column and value.
+     *
+     * @param column The column to run the comparison on
+     * @param value The value to compare against.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria and(Column column, Object value)
+    {
+        return and(column, value, EQUAL);
+    }
+
+    /**
+     * "AND"s a new condition with the conditions in this Criteria.
+     * This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().and("column", &quot;value&quot;);
+     * </code>
+     *
+     * An EQUAL comparison is used for column and value.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param value The value to compare against.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria and(String column, Object value)
+    {
+        return and(new ColumnImpl(column), value, EQUAL);
+    }
+
+    /**
+     * "AND"s a new condition with the conditions in this Criteria.
+     * This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().and(column,
+     *                                      &quot;value&quot;
+     *                                      Criteria.GREATER_THAN);
+     * </code>
+     *
+     * Any comparison can be used.
+     *
+     * @param column The column to run the comparison on
+     * @param value The value to compare against.
+     * @param comparison the comparison, or <code>Criteria.CUSTOM</code>
+     *        to specify the comparison and right hand side of the expression
+     *        manually in the value parameter.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria and(Column column, Object value, SqlEnum comparison)
+    {
+        Criterion nc = new Criterion(column, value, comparison);
+        if (topLevelCriterion == null)
+        {
+            topLevelCriterion = nc;
+        }
+        else
+        {
+            topLevelCriterion.and(nc);
+        }
+        return this;
+    }
+
+    /**
+     * "AND"s a new condition with the conditions in this Criteria.
+     * This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().and(&quot;column&quot;,
+     *                                      &quot;value&quot;
+     *                                      Criteria.GREATER_THAN);
+     * </code>
+     *
+     * Any comparison can be used.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param value The value to compare against.
+     * @param comparison the comparison, or <code>Criteria.CUSTOM</code>
+     *        to specify the comparison and right hand side of the expression
+     *        manually in the value parameter.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria and(String column, Object value, SqlEnum comparison)
+    {
+        Criterion nc = new Criterion(new ColumnImpl(column), value, comparison);
+        if (topLevelCriterion == null)
+        {
+            topLevelCriterion = nc;
+        }
+        else
+        {
+            topLevelCriterion.and(nc);
+        }
+        return this;
+    }
+
+    /**
+     * Convenience method to AND a new date comparison with the conditions
+     * in this Criteria. Equal to
+     * <p>
+     * <code>
+     * and(column, new GregorianCalendar(year, month,date), EQUAL);
+     * </code>
+     *
+     * @param column The column to compare against.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @return A modified Criteria object.
+     */
+    public Criteria andDate(Column column, int year, int month, int day)
+    {
+        return and(column, new GregorianCalendar(year, month, day).getTime(),
+                Criteria.EQUAL);
+    }
+
+    /**
+     * Convenience method to AND a new date comparison with the conditions
+     * in this Criteria. Equal to
+     * <p>
+     * <code>
+     * and(column, new GregorianCalendar(year, month,date), EQUAL);
+     * </code>
+     *
+     * @param column The name of the column to compare against.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @return A modified Criteria object.
+     */
+    public Criteria andDate(String column, int year, int month, int day)
+    {
+        return and(new ColumnImpl(column),
+                new GregorianCalendar(year, month, day).getTime(),
+                Criteria.EQUAL);
+    }
+
+    /**
+     * Convenience method to AND a new date comparison with the conditions
+     * in this Criteria. Equal to
+     * <p>
+     * <code>
+     * and(column, new GregorianCalendar(year, month,date), comparison);
+     * </code>
+     *
+     * @param column The column to run the comparison on.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @param comparison The comparison operator.
+     * @return A modified Criteria object.
+     */
+    public Criteria andDate(Column column, int year, int month, int date,
+            SqlEnum comparison)
+    {
+        return and(column,
+                new GregorianCalendar(year, month, date).getTime(),
+                comparison);
+    }
+
+    /**
+     * Convenience method to AND a new date comparison with the conditions
+     * in this Criteria. Equal to
+     * <p>
+     * <code>
+     * and(column, new GregorianCalendar(year, month,date), comparison);
+     * </code>
+     *
+     * @param column The name of the column to run the comparison on.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @param comparison The comparison operator.
+     * @return A modified Criteria object.
+     */
+    public Criteria andDate(String column, int year, int month, int date,
+            SqlEnum comparison)
+    {
+        return and(new ColumnImpl(column),
+                new GregorianCalendar(year, month, date).getTime(),
+                comparison);
+    }
+
+    /**
+     * Convenience method to AND a "in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria andIn(Column column, Object[] values)
+    {
+        return and(column, values, Criteria.IN);
+    }
+
+    /**
+     * Convenience method to AND a "in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria andIn(String column, Object[] values)
+    {
+        return and(new ColumnImpl(column), values, Criteria.IN);
+    }
+
+    /**
+     * Convenience method to AND a "in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria andIn(Column column, Collection<?> values)
+    {
+        return and(column, values, Criteria.IN);
+    }
+
+    /**
+     * Convenience method to AND a "in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria andIn(String column, Collection<?> values)
+    {
+        return and(new ColumnImpl(column), values, Criteria.IN);
+    }
+
+    /**
+     * Convenience method to AND a "not in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME NOT IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria andNotIn(Column column, Object[] values)
+    {
+        return and(column, values, Criteria.NOT_IN);
+    }
+
+    /**
+     * Convenience method to AND a "not in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME NOT IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria andNotIn(String column, Object[] values)
+    {
+        return and(new ColumnImpl(column), values, Criteria.NOT_IN);
+    }
+
+    /**
+     * Convenience method to AND a "not in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME NOT IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria andNotIn(Column column, Collection<?> values)
+    {
+        return and(column, values, Criteria.NOT_IN);
+    }
+
+    /**
+     * Convenience method to AND a "not in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME NOT IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria andNotIn(String column, Collection<?> values)
+    {
+        return and(new ColumnImpl(column), values, Criteria.NOT_IN);
+    }
+
+    /*
+     * ------------------------------------------------------------------------
+     *
+     * Start of the "or" methods
+     *
+     * ------------------------------------------------------------------------
+     */
+
+    /**
+     * "OR"s a Criterion object with the conditions in this Criteria.
+     * This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria();
+     * Criterion c = new Criterion(BasePeer.ID, new Integer(5),
+     *         Criteria.LESS_THAN);
+     * crit.or(c);
+     * </code>
+     *
+     * @param criterion A Criterion object.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria or(Criterion criterion)
+    {
+        if (topLevelCriterion == null)
+        {
+            topLevelCriterion = criterion;
+        }
+        else
+        {
+            topLevelCriterion.or(criterion);
+        }
+        return this;
+    }
+
+    /**
+     * "OR"s a new condition with the conditions in this Criteria.
+     * This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().or(column, &quot;value&quot;);
+     * </code>
+     *
+     * An EQUAL comparison is used for column and value.
+     *
+     * @param column The column to run the comparison on
+     * @param value The value to compare against.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria or(Column column, Object value)
+    {
+        return or(column, value, EQUAL);
+    }
+
+    /**
+     * "OR"s a new condition with the conditions in this Criteria.
+     * This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().or("column", &quot;value&quot;);
+     * </code>
+     *
+     * An EQUAL comparison is used for column and value.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param value The value to compare against.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria or(String column, Object value)
+    {
+        return or(new ColumnImpl(column), value, EQUAL);
+    }
+
+    /**
+     * "OR"s a new condition with the conditions in this Criteria.
+     * This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().or(column,
+     *                                      &quot;value&quot;
+     *                                      Criteria.GREATER_THAN);
+     * </code>
+     *
+     * Any comparison can be used.
+     *
+     * @param column The column to run the comparison on
+     * @param value The value to compare against.
+     * @param comparison the comparison, or <code>Criteria.CUSTOM</code>
+     *        to specify the comparison and right hand side of the expression
+     *        manually in the value parameter.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria or(Column column, Object value, SqlEnum comparison)
+    {
+        Criterion nc = new Criterion(column, value, comparison);
+        if (topLevelCriterion == null)
+        {
+            topLevelCriterion = nc;
+        }
+        else
+        {
+            topLevelCriterion.or(nc);
+        }
+        return this;
+    }
+
+    /**
+     * "OR"s a new condition with the conditions in this Criteria.
+     * This is used as follows:
+     * <p>
+     * <code>
+     * Criteria crit = new Criteria().or(&quot;column&quot;,
+     *                                      &quot;value&quot;
+     *                                      Criteria.GREATER_THAN);
+     * </code>
+     *
+     * Any comparison can be used.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param value The value to compare against.
+     * @param comparison the comparison, or <code>Criteria.CUSTOM</code>
+     *        to specify the comparison and right hand side of the expression
+     *        manually in the value parameter.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria or(String column, Object value, SqlEnum comparison)
+    {
+        Criterion nc = new Criterion(new ColumnImpl(column), value, comparison);
+        if (topLevelCriterion == null)
+        {
+            topLevelCriterion = nc;
+        }
+        else
+        {
+            topLevelCriterion.or(nc);
+        }
+        return this;
+    }
+
+    /**
+     * Convenience method to OR a new date comparison with the conditions
+     * in this Criteria. Equal to
+     * <p>
+     * <code>
+     * or(column, new GregorianCalendar(year, month,date), EQUAL);
+     * </code>
+     *
+     * @param column The column to compare against.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @return A modified Criteria object.
+     */
+    public Criteria orDate(Column column, int year, int month, int day)
+    {
+        return or(column, new GregorianCalendar(year, month, day).getTime(),
+                Criteria.EQUAL);
+    }
+
+    /**
+     * Convenience method to OR a new date comparison with the conditions
+     * in this Criteria. Equal to
+     * <p>
+     * <code>
+     * or(column, new GregorianCalendar(year, month,date), EQUAL);
+     * </code>
+     *
+     * @param column The name of the column to compare against.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @return A modified Criteria object.
+     */
+    public Criteria orDate(String column, int year, int month, int day)
+    {
+        return or(new ColumnImpl(column),
+                new GregorianCalendar(year, month, day).getTime(),
+                Criteria.EQUAL);
+    }
+
+    /**
+     * Convenience method to OR a new date comparison with the conditions
+     * in this Criteria. Equal to
+     * <p>
+     * <code>
+     * or(column, new GregorianCalendar(year, month,date), comparison);
+     * </code>
+     *
+     * @param column The column to run the comparison on.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @param comparison The comparison operator.
+     * @return A modified Criteria object.
+     */
+    public Criteria orDate(Column column, int year, int month, int date,
+            SqlEnum comparison)
+    {
+        return or(column,
+                new GregorianCalendar(year, month, date).getTime(),
+                comparison);
+    }
+
+    /**
+     * Convenience method to OR a new date comparison with the conditions
+     * in this Criteria. Equal to
+     * <p>
+     * <code>
+     * or(column, new GregorianCalendar(year, month,date), comparison);
+     * </code>
+     *
+     * @param column The name of the column to run the comparison on.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @param comparison The comparison operator.
+     * @return A modified Criteria object.
+     */
+    public Criteria orDate(String column, int year, int month, int date,
+            SqlEnum comparison)
+    {
+        return or(new ColumnImpl(column),
+                new GregorianCalendar(year, month, date).getTime(),
+                comparison);
+    }
+
+    /**
+     * Convenience method to OR a "in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria orIn(Column column, Object[] values)
+    {
+        return or(column, values, Criteria.IN);
+    }
+
+    /**
+     * Convenience method to OR a "in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria orIn(String column, Object[] values)
+    {
+        return or(new ColumnImpl(column), values, Criteria.IN);
+    }
+
+    /**
+     * Convenience method to OR a "in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria orIn(Column column, Collection<?> values)
+    {
+        return or(column, values, Criteria.IN);
+    }
+
+    /**
+     * Convenience method to OR a "in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria orIn(String column, Collection<?> values)
+    {
+        return or(new ColumnImpl(column), values, Criteria.IN);
+    }
+
+    /**
+     * Convenience method to OR a "not in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME NOT IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria orNotIn(Column column, Object[] values)
+    {
+        return or(column, values, Criteria.NOT_IN);
+    }
+
+    /**
+     * Convenience method to OR a "not in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME NOT IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria orNotIn(String column, Object[] values)
+    {
+        return or(new ColumnImpl(column), values, Criteria.NOT_IN);
+    }
+
+    /**
+     * Convenience method to OR a "not in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME NOT IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria orNotIn(Column column, Collection<?> values)
+    {
+        return or(column, values, Criteria.NOT_IN);
+    }
+
+    /**
+     * Convenience method to OR a "not in" comparison with the conditions
+     * in this Criteria. Creates the condition
+     * <p>
+     * FOO.NAME NOT IN (${values})
+     * <p>
+     * where ${values} contains the values to compare against.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria orNotIn(String column, Collection<?> values)
+    {
+        return or(new ColumnImpl(column), values, Criteria.NOT_IN);
+    }
+
+    /*
+     * ------------------------------------------------------------------------
+     *
+     * Start of the "where" methods
+     *
+     * ------------------------------------------------------------------------
+     */
+
+    /**
+     * "AND"s Criterion object with the conditions in this Criteria.
+     * Equivalent to <code>#and(Criterion)</code> but better to read if this is
+     * the first condition to be added to the Criteria.
+     *
+     * @param criterion A Criterion object.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria where(Criterion criterion)
+    {
+        return and(criterion);
+    }
+
+    /**
+     * "AND"s a new condition with the conditions in this Criteria.
+     * Equivalent to <code>#and(Column, Object)</code> but better to read
+     * if this is the first condition to be added to the Criteria.
+     *
+     * @param column The column to run the comparison on
+     * @param value The value to compare against.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria where(Column column, Object value)
+    {
+        return and(column, value);
+    }
+
+    /**
+     * "AND"s a new condition with the conditions in this Criteria.
+     * Equivalent to <code>#and(String, Object)</code> but better to read
+     * if this is the first condition to be added to the Criteria.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param value The value to compare against.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria where(String column, Object value)
+    {
+        return and(new ColumnImpl(column), value);
+    }
+
+    /**
+     * "AND"s a new condition with the conditions in this Criteria.
+     * Equivalent to <code>#and(Column, Object, SqlEnum)</code> but better to
+     * read if this is the first condition to be added to the Criteria.
+     *
+     * @param column The column to run the comparison on
+     * @param value The value to compare against.
+     * @param comparison the comparison, or <code>Criteria.CUSTOM</code>
+     *        to specify the comparison and right hand side of the expression
+     *        manually in the value parameter.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria where(Column column, Object value, SqlEnum comparison)
+    {
+        return and(column, value, comparison);
+    }
+
+    /**
+     * "AND"s a new condition with the conditions in this Criteria.
+     * Equivalent to <code>#and(String, Object, SqlEnum)</code> but better to
+     * read if this is the first condition to be added to the Criteria.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param value The value to compare against.
+     * @param comparison the comparison, or <code>Criteria.CUSTOM</code>
+     *        to specify the comparison and right hand side of the expression
+     *        manually in the value parameter.
+     *
+     * @return A modified Criteria object.
+     */
+    public Criteria where(String column, Object value, SqlEnum comparison)
+    {
+        return and(new ColumnImpl(column), value, comparison);
+    }
+
+    /**
+     * Convenience method to AND a new date comparison with the conditions
+     * in this Criteria. Equivalent to
+     * <code>#andDate(Column, int, int, int)</code> but better to read
+     * if this is the first condition to be added to the Criteria.
+     *
+     * @param column The column to compare against.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereDate(Column column, int year, int month, int day)
+    {
+        return andDate(column, year, month, day);
+    }
+
+    /**
+     * Convenience method to AND a new date comparison with the conditions
+     * in this Criteria. Equivalent to
+     * <code>#andDate(String, int, int, int)</code> but better to read
+     * if this is the first condition to be added to the Criteria.
+     *
+     * @param column The name of the column to compare against.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereDate(String column, int year, int month, int day)
+    {
+        return andDate(new ColumnImpl(column), year, month, day);
+    }
+
+    /**
+     * Convenience method to AND a new date comparison with the conditions
+     * in this Criteria. Equivalent to
+     * <code>#andDate(Column, int, int, int, SqlEnum)</code> but better to read
+     * if this is the first condition to be added to the Criteria.
+     *
+     * @param column The column to run the comparison on.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @param comparison The comparison operator.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereDate(Column column, int year, int month, int day,
+            SqlEnum comparison)
+    {
+        return andDate(column, year, month, day, comparison);
+    }
+
+    /**
+     * Convenience method to AND a new date comparison with the conditions
+     * in this Criteria. Equivalent to
+     * <code>#andDate(String, int, int, int, SqlEnum)</code> but better to read
+     * if this is the first condition to be added to the Criteria.
+     *
+     * @param column The name of the column to run the comparison on.
+     * @param year The year to compare to.
+     * @param month The month to compare to.
+     * @param day The day to compare to.
+     * @param comparison The comparison operator.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereDate(String column, int year, int month, int day,
+            SqlEnum comparison)
+    {
+        return andDate(new ColumnImpl(column), year, month, day, comparison);
+    }
+
+    /**
+     * Convenience method to AND a "in" comparison with the conditions
+     * in this Criteria. Equivalent to <code>#andIn(Column, Object[])</code>
+     * but better to read if this is the first condition to be added
+     * to the Criteria.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereIn(Column column, Object[] values)
+    {
+        return andIn(column, values);
+    }
+
+    /**
+     * Convenience method to AND a "in" comparison with the conditions
+     * in this Criteria. Equivalent to <code>#andIn(String, Object[])</code>
+     * but better to read if this is the first condition to be added
+     * to the Criteria.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereIn(String column, Object[] values)
+    {
+        return andIn(new ColumnImpl(column), values);
+    }
+
+    /**
+     * Convenience method to AND a "in" comparison with the conditions
+     * in this Criteria. Equivalent to <code>#andIn(Column, Collection)</code>
+     * but better to read if this is the first condition to be added
+     * to the Criteria.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereIn(Column column, Collection<?> values)
+    {
+        return andIn(column, values);
+    }
+
+    /**
+     * Convenience method to AND a "in" comparison with the conditions
+     * in this Criteria. Equivalent to <code>#andIn(String, Collection)</code>
+     * but better to read if this is the first condition to be added
+     * to the Criteria.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereIn(String column, Collection<?> values)
+    {
+        return andIn(new ColumnImpl(column), values);
+    }
+
+    /**
+     * Convenience method to AND a "not in" comparison with the conditions
+     * in this Criteria. Equivalent to
+     * <code>#andNotIn(Column, Object[])</code> but better to read
+     * if this is the first condition to be added to the Criteria.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereNotIn(Column column, Object[] values)
+    {
+        return andNotIn(column, values);
+    }
+
+    /**
+     * Convenience method to AND a "not in" comparison with the conditions
+     * in this Criteria. Equivalent to
+     * <code>#andNotIn(String, Object[])</code> but better to read
+     * if this is the first condition to be added to the Criteria.
+     *
+     * @param column The name of the column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereNotIn(String column, Object[] values)
+    {
+        return andNotIn(new ColumnImpl(column), values);
+    }
+
+    /**
+     * Convenience method to AND a "not in" comparison with the conditions
+     * in this Criteria. Equivalent to
+     * <code>#andNotIn(Column, Collection)</code> but better to read
+     * if this is the first condition to be added to the Criteria.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereNotIn(Column column, Collection<?> values)
+    {
+        return andNotIn(column, values);
+    }
+
+    /**
+     * Convenience method to AND a "not in" comparison with the conditions
+     * in this Criteria. Equivalent to
+     * <code>#andNotIn(String, Collection)</code> but better to read
+     * if this is the first condition to be added to the Criteria.
+     *
+     * @param column The column to run the comparison on
+     * @param values The values to compare against.
+     * @return A modified Criteria object.
+     */
+    public Criteria whereNotIn(String column, Collection<?> values)
+    {
+        return andNotIn(new ColumnImpl(column), values);
+    }
+}



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


Mime
View raw message