java.lang.Objectorg.objectweb.telosys.common.TelosysObject
org.objectweb.telosys.dal.sql.Criteria
A Criteria object is a collection of Criterion objects to be used together to build dynamic SQL Queries
Constructor Summary | |
Criteria(Criterion[] critArray)
Build a new criteria ( collection of criterion objects ) with the defaut "and" operator |
|
Criteria(Criterion[] critArray,
java.lang.String sOperator)
Build a new criteria ( collection of criterion objects ) |
Method Summary | |
int |
applyParameters(java.util.Map params)
Apply the given parameters to the criteria, each Criterion parameter name is used to try to find a parameter value in the given Map. |
void |
doNotUse(int i)
Fix the given criterion as "not used" |
int |
getCount()
Returns the number of criteria |
java.lang.String[] |
getDynamicParameters()
Build a String array containing the useful parameters values |
int[] |
getDynamicTypes()
Build a int array containing the useful parameters types |
java.lang.String |
getDynamicWhere()
Build the SQL where clause dynamicaly with the useful criterion objects |
java.lang.String |
getOperator()
Returns the current operator for criteria combination ( "and" or "or" ) |
int |
getParamType(int i)
Return the parameter type expected for the given criterion index |
java.lang.String |
getSqlExpression(int i)
Return the SQL criterion expression ( ie "thecolumn = ?" |
Criterion[] |
getUsefulCriteria()
Build an array containing the useful Criterion objects |
int |
getUsefulParametersCount()
Return the number of useful parameters |
void |
reset()
Reset each criterion as "not used" |
void |
useWithValue(int i,
java.lang.String sParamVal)
Fix the given criterion as "useful" and set its parameter value |
Methods inherited from class org.objectweb.telosys.common.TelosysObject |
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Criteria(Criterion[] critArray)
critArray
- array of criterion objects to be used in conjunction for dynamic requestpublic Criteria(Criterion[] critArray, java.lang.String sOperator)
critArray
- array of criterion objects to be used in conjunction for dynamic requestsOperator
- where operator to use between each criterion ( "and" / "or" )Method Detail |
public java.lang.String getOperator()
public int getCount()
public java.lang.String getSqlExpression(int i)
i
- criterion index ( from 1 to N )
public int getParamType(int i)
i
- criterion index ( from 1 to N )
public int applyParameters(java.util.Map params)
params
- the parameters to apply
public void useWithValue(int i, java.lang.String sParamVal)
i
- criterion index ( from 1 to N )sParamVal
- criterion parameter valuepublic void doNotUse(int i)
i
- criterion index ( from 1 to N )public void reset()
public java.lang.String getDynamicWhere()
public int getUsefulParametersCount()
public int[] getDynamicTypes()
public java.lang.String[] getDynamicParameters()
public Criterion[] getUsefulCriteria()