org.syrup.sql
Class QueryOperation

java.lang.Object
  extended byorg.syrup.sql.QueryOperation

public class QueryOperation
extends java.lang.Object

Temporary data structure to aid the construction of qualified SQL queries.

Author:
Robbert van Dalen

Field Summary
 java.lang.String sqlAtt
          The SQL attribute.
 java.lang.String sqlOp
          The SQL qualifier.
 java.lang.String templAtt
          The Template attribute.
 java.lang.Integer templOp
          The Template qualifier.
 java.lang.Object value
          The qualifier value.
 
Constructor Summary
QueryOperation(Template t, java.lang.String sAtt, java.lang.String tAtt)
          Constructor for the QueryOperation object
 
Method Summary
protected  java.lang.String boolean_op(int i)
          Returns the SQL (boolean)qualifier based on the Template qualifier
protected  java.lang.String number_op(int i)
          Returns the SQL (number)qualifier based on the Template qualifier
protected  java.lang.String queryOp(java.lang.Integer i, java.lang.Object o)
          Returns the mapped SQL qualifier based on the Template qualifier and the qualifier value.
protected  java.lang.String string_op(int i)
          Returns the SQL (string)qualifier based on the Template qualifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

public final java.lang.Object value
The qualifier value.


sqlOp

public final java.lang.String sqlOp
The SQL qualifier.


sqlAtt

public final java.lang.String sqlAtt
The SQL attribute.


templAtt

public final java.lang.String templAtt
The Template attribute.


templOp

public final java.lang.Integer templOp
The Template qualifier.

Constructor Detail

QueryOperation

public QueryOperation(Template t,
                      java.lang.String sAtt,
                      java.lang.String tAtt)
               throws java.lang.Exception
Constructor for the QueryOperation object

Parameters:
t - The Template specifying all the qualifiers.
sAtt - The SQL attribute (i.e. parent_key).
tAtt - The Template attribute (i.e. parentKey).
Method Detail

queryOp

protected java.lang.String queryOp(java.lang.Integer i,
                                   java.lang.Object o)
                            throws java.lang.Exception
Returns the mapped SQL qualifier based on the Template qualifier and the qualifier value.

Parameters:
i - The Template qualifier.
o - The qualifier value.
Returns:
The mapped SQL qualifier.
Throws:
java.lang.Exception

number_op

protected java.lang.String number_op(int i)
                              throws java.lang.Exception
Returns the SQL (number)qualifier based on the Template qualifier

Parameters:
i - The Template qualifier.
Returns:
The SQL (number)qualifier based on the Template qualifier
Throws:
java.lang.Exception

string_op

protected java.lang.String string_op(int i)
                              throws java.lang.Exception
Returns the SQL (string)qualifier based on the Template qualifier

Parameters:
i - The Template qualifier.
Returns:
The SQL (string)qualifier based on the Template qualifier
Throws:
java.lang.Exception

boolean_op

protected java.lang.String boolean_op(int i)
                               throws java.lang.Exception
Returns the SQL (boolean)qualifier based on the Template qualifier

Parameters:
i - The Template qualifier.
Returns:
The SQL (boolean)qualifier based on the Template qualifier
Throws:
java.lang.Exception