net.sourceforge.pbeans
Interface Operator

All Known Implementing Classes:
SimpleOperator

public interface Operator

Operator generates an SQL operation on two expressions.

Author:
Marius Siegas

Field Summary
static Operator EQUALS
          Common operator equals ("=").
static Operator GREATER_THAN
          Operator greater than (">").
static Operator IN
           
static Operator IS
          Operator is (" IS ") for comparing to null.
static Operator LESS_THAN
          Operator less than ("<").
static Operator LIKE
           
 
Method Summary
 java.lang.String operation(java.lang.String variable, java.lang.String value)
          Generates SQL operation using given expressions as arguments.
 java.lang.String operatorString()
           
 

Field Detail

EQUALS

static final Operator EQUALS
Common operator equals ("="). Automaticaly replaced to IS when comparing to null value.


IS

static final Operator IS
Operator is (" IS ") for comparing to null.

See Also:
EQUALS

LESS_THAN

static final Operator LESS_THAN
Operator less than ("<").


GREATER_THAN

static final Operator GREATER_THAN
Operator greater than (">").


LIKE

static final Operator LIKE

IN

static final Operator IN
Method Detail

operation

java.lang.String operation(java.lang.String variable,
                           java.lang.String value)
Generates SQL operation using given expressions as arguments. The resulting string should containt the two specified strings in it. Also there must be enough spacing around operation (if needed) for it not to collapse with expressions.

Parameters:
variable - variable expression (i.e. left-hand expression).
value - value expression (i.e. right-hand expression).
Returns:
generated string containing variable, value and the operation(-s) performed on them.

operatorString

java.lang.String operatorString()