org.objectweb.telosys.dal.sql
Class Criterion

java.lang.Object
  extended byorg.objectweb.telosys.dal.sql.Criterion
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SQLCriteria

public class Criterion
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Criterion(java.lang.String sSqlExpression, int iType)
          Creates a new Criterion object
Criterion(java.lang.String sSqlExpression, int iType, java.lang.String sParamName)
          Creates a new Criterion object
 
Method Summary
 void doNotUse()
          Declare this criterion as not to be used
 java.lang.String getParamName()
          Returns the name of the parameter associated with this criterion
 int getParamType()
          Returns the type of the parameter associated with this criterion
See the constants in "ParamType"
 java.lang.Object getParamValueAsObject()
          Returns the parameter value associated with this criterion
 java.lang.String getParamValueAsString()
          Returns the parameter value associated with this criterion
 java.lang.String getSqlExpression()
          Returns the SQL expression of this criterion ( eg : "agency = ?"
 boolean isUsed()
          Returns true if this criterion is used in the SQL request
 void useWithValue(java.lang.String sParamVal)
          Declares this criterion as to be used with the given parameter value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Criterion

public Criterion(java.lang.String sSqlExpression,
                 int iType)
Creates a new Criterion object

Parameters:
sSqlExpression - the SQL criterion expression ( eg : "agency = ?", "code > ?", ... )
iType - the criterion parameter type ( eg : STRING, INTEGER, ... ) ( see "ParamType" )

Criterion

public Criterion(java.lang.String sSqlExpression,
                 int iType,
                 java.lang.String sParamName)
Creates a new Criterion object

Parameters:
sSqlExpression - the SQL criterion expression ( eg : "agency = ?", "code > ?", ... )
iType - the criterion parameter type ( eg : STRING, INTEGER, ... ) ( see "ParamType" )
sParamName - the name of the parameter associated with the criterion
Since:
1.1.0
Method Detail

getSqlExpression

public java.lang.String getSqlExpression()
Returns the SQL expression of this criterion ( eg : "agency = ?", "name like ?", ... )

Returns:

getParamType

public int getParamType()
Returns the type of the parameter associated with this criterion
See the constants in "ParamType"

Returns:

getParamName

public java.lang.String getParamName()
Returns the name of the parameter associated with this criterion

Returns:

getParamValueAsString

public java.lang.String getParamValueAsString()
Returns the parameter value associated with this criterion

Returns:

getParamValueAsObject

public java.lang.Object getParamValueAsObject()
Returns the parameter value associated with this criterion

Returns:

useWithValue

public void useWithValue(java.lang.String sParamVal)
Declares this criterion as to be used with the given parameter value

Parameters:
sParamVal -

doNotUse

public void doNotUse()
Declare this criterion as not to be used


isUsed

public boolean isUsed()
Returns true if this criterion is used in the SQL request

Returns: