org.jminor.common.db.criteria
Class SimpleCriteria<T>

java.lang.Object
  extended by org.jminor.common.db.criteria.SimpleCriteria<T>
All Implemented Interfaces:
Serializable, Criteria<T>

public final class SimpleCriteria<T>
extends Object
implements Criteria<T>, Serializable

Encapsulates a simple free-form query criteria.

See Also:
Serialized Form

Constructor Summary
SimpleCriteria(String criteriaString)
          Instantiates a new SimpleCriteria
SimpleCriteria(String criteriaString, List<Object> values, List<T> keys)
          Instantiates a new SimpleCriteria
 
Method Summary
 String asString()
          
 List<T> getValueKeys()
          
 List<Object> getValues()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCriteria

public SimpleCriteria(String criteriaString)
Instantiates a new SimpleCriteria

Parameters:
criteriaString - the criteria string

SimpleCriteria

public SimpleCriteria(String criteriaString,
                      List<Object> values,
                      List<T> keys)
Instantiates a new SimpleCriteria

Parameters:
criteriaString - the criteria string
values - the values required by this criteria string
keys - the keys required by this criteria string, in the same order as their respective values
Method Detail

asString

public String asString()

Specified by:
asString in interface Criteria<T>
Returns:
a SQL where condition string without the 'where' keyword

getValues

public List<Object> getValues()

Specified by:
getValues in interface Criteria<T>
Returns:
a list of the values this criteria is based on, in the order they appear in the condition clause.

getValueKeys

public List<T> getValueKeys()

Specified by:
getValueKeys in interface Criteria<T>
Returns:
a list of T describing the values this criteria is based on, in the same order as their respective values appear in the condition clause