com.konakart.bl
Class KKCriteria

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable
          extended by org.apache.torque.util.Criteria
              extended by com.konakart.bl.KKCriteria
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public class KKCriteria
extends org.apache.torque.util.Criteria

KKCriteria

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.torque.util.Criteria
org.apache.torque.util.Criteria.Criterion, org.apache.torque.util.Criteria.Join
 
Field Summary
 
Fields inherited from class org.apache.torque.util.Criteria
ALL, ALT_NOT_EQUAL, CURRENT_DATE, CURRENT_TIME, CUSTOM, DISTINCT, EQUAL, GREATER_EQUAL, GREATER_THAN, ILIKE, IN, INNER_JOIN, ISNOTNULL, ISNULL, JOIN, LEFT_JOIN, LESS_EQUAL, LESS_THAN, LIKE, NOT_EQUAL, NOT_ILIKE, NOT_IN, NOT_LIKE, RIGHT_JOIN
 
Constructor Summary
KKCriteria()
          Constructor
KKCriteria(java.lang.String dbName)
          Constructor
 
Method Summary
 org.apache.torque.util.Criteria add(java.lang.String column, java.lang.Object value, org.apache.torque.util.SqlEnum comparison)
          This method adds a new criterion to the list of criterias.
 org.apache.torque.util.Criteria addAscendingOrderByColumn(java.lang.String name)
          Add order by column name, explicitly specifying ascending.
 org.apache.torque.util.Criteria addDescendingOrderByColumn(java.lang.String name)
          Add order by column name, explicitly specifying descending.
 void addForInsert(java.lang.String attrName, int value)
          A utility method to not add integers that are equal to BaseMgr.NOT_INITIALISED
 void addForInsert(java.lang.String attrName, java.lang.Object value)
          A utility to not add null objects
 org.apache.torque.util.Criteria addJoin(java.lang.String left, java.lang.String right)
          This is the way that you should add a join of two tables.
 org.apache.torque.util.Criteria addSelectColumn(java.lang.String name)
          Add select column.
 org.apache.torque.util.Criteria or(java.lang.String column, java.lang.Object value, org.apache.torque.util.SqlEnum comparison)
          This method adds a new OR criterion to the list of criteria.
 java.lang.String standardisedColumn(java.lang.String column)
          Return a "standardised" column name.
 
Methods inherited from class org.apache.torque.util.Criteria
add, add, add, add, add, add, add, add, add, add, add, add, add, add, addAlias, addAsColumn, addDate, addDate, addGroupByColumn, addHaving, addIn, addIn, addIn, addJoin, addNotIn, addNotIn, addNotIn, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, andDate, andDate, andIn, andIn, andIn, andNotIn, andNotIn, andNotIn, clear, containsKey, equals, get, getAliases, getAsColumns, getBigDecimal, getBigDecimal, getBoolean, getBoolean, getColumnName, getComparison, getComparison, getCriterion, getCriterion, getDate, getDate, getDbName, getDouble, getDouble, getFloat, getFloat, getGroupByColumns, getHaving, getInt, getInt, getInteger, getInteger, getJoinL, getJoinR, getJoins, getLimit, getList, getList, getLong, getLong, getNewCriterion, getNewCriterion, getNewCriterion, getObjectKey, getObjectKey, getOffset, getOrderByColumns, getSearch, getSearchCriteria, getSelectColumns, getSelectModifiers, getStoreId, getString, getString, getTableForAlias, getTableName, getValue, getValue, hashCode, isCascade, isIgnoreCase, isSingleRecord, isUseTransaction, or, or, or, or, or, or, or, or, or, or, or, or, or, or, orDate, orDate, orIn, orIn, orIn, orNotIn, orNotIn, orNotIn, put, putAll, remove, setAll, setCascade, setDbName, setDistinct, setIgnoreCase, setLimit, setOffset, setSingleRecord, setStoreId, setUseTransaction, toString
 
Methods inherited from class java.util.Hashtable
clone, contains, containsKey, containsValue, elements, entrySet, isEmpty, keys, keySet, rehash, remove, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KKCriteria

public KKCriteria()
Constructor


KKCriteria

public KKCriteria(java.lang.String dbName)
Constructor

Parameters:
dbName -
Method Detail

addForInsert

public void addForInsert(java.lang.String attrName,
                         int value)
A utility method to not add integers that are equal to BaseMgr.NOT_INITIALISED

Parameters:
attrName -
value -

addForInsert

public void addForInsert(java.lang.String attrName,
                         java.lang.Object value)
A utility to not add null objects

Parameters:
attrName -
value -

add

public org.apache.torque.util.Criteria add(java.lang.String column,
                                           java.lang.Object value,
                                           org.apache.torque.util.SqlEnum comparison)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is replaced. If is used as follow:

Criteria crit = new Criteria().add("column", "value" Criteria.GREATER_THAN); Any comparison can be used. The name of the table must be used implicitly in the column name, so the Column name must be something like 'TABLE.id'. If you don't like this, you can use the add(table, column, value) method.

Overrides:
add in class org.apache.torque.util.Criteria
Parameters:
column - The column to run the comparison on
value - An Object.
comparison - A String.
Returns:
A modified Criteria object.

or

public org.apache.torque.util.Criteria or(java.lang.String column,
                                          java.lang.Object value,
                                          org.apache.torque.util.SqlEnum comparison)
This method adds a new OR criterion to the list of criteria. It is used as follow:

Criteria crit = new Criteria().add("column", "value" Criteria.GREATER_THAN); crit.or("column", "value" Criteria.GREATER_THAN); Any comparison can be used. The name of the table must be used implicitly in the column name, so the Column name must be something like 'TABLE.id'. If you don't like this, you can use the add(table, column, value) method.

Overrides:
or in class org.apache.torque.util.Criteria
Parameters:
column - The column to run the comparison on
value - An Object.
comparison - A String.
Returns:
A modified Criteria object.

addSelectColumn

public org.apache.torque.util.Criteria addSelectColumn(java.lang.String name)
Add select column.

Overrides:
addSelectColumn in class org.apache.torque.util.Criteria
Parameters:
name - A String with the name of the select column.
Returns:
A modified Criteria object.

addJoin

public org.apache.torque.util.Criteria addJoin(java.lang.String left,
                                               java.lang.String right)
This is the way that you should add a join of two tables. For example:

AND PROJECT.PROJECT_ID=FOO.PROJECT_ID

left = PROJECT.PROJECT_ID right = FOO.PROJECT_ID

Overrides:
addJoin in class org.apache.torque.util.Criteria
Parameters:
left - A String with the left side of the join.
right - A String with the right side of the join.
Returns:
A modified Criteria object.

addAscendingOrderByColumn

public org.apache.torque.util.Criteria addAscendingOrderByColumn(java.lang.String name)
Add order by column name, explicitly specifying ascending.

Overrides:
addAscendingOrderByColumn in class org.apache.torque.util.Criteria
Parameters:
name - The name of the column to order by.
Returns:
A modified Criteria object.

addDescendingOrderByColumn

public org.apache.torque.util.Criteria addDescendingOrderByColumn(java.lang.String name)
Add order by column name, explicitly specifying descending.

Overrides:
addDescendingOrderByColumn in class org.apache.torque.util.Criteria
Parameters:
name - The name of the column to order by.
Returns:
A modified Criteria object.

standardisedColumn

public java.lang.String standardisedColumn(java.lang.String column)
Return a "standardised" column name. Due to various limitations of some databases (eg. Oracle only allows 30-char table and column names) we sometimes have to shorten the column names. We call this shortening "standardisation".

Parameters:
column -
Returns:
a standardised column name which will be appropriate for the current database.


Copyright © 2011 DS Data Systems UK Ltd.