com.quadrique.jbuildingblocks.core.database
Class JbbSqlClause

java.lang.Object
  extended by com.quadrique.jbuildingblocks.core.database.JbbSqlClause

public class JbbSqlClause
extends Object

This class simplifies the dynamic creation of SQL statement by allowing you to have well formatted groups of SQL commands (e.g. " T_Users.zipCode = 33445 ") that are properly combined. If you provide one group, the resulting clause is " ( group ) " If you provide 2 groups and specify AND as the logical operator, the resulting clause is " ( group1 ) AND (group2) " If you provide 3 groups and specify AND as the logical operator, the resulting clause is " ( group1 ) OR (group2) OR (group3) "


Method Summary
 void addGroup(String group)
          trim, make sure the group is properly enclosed in () and add it to the internal list
 String getSqlClause()
           
 boolean isLogicalOperatorAND()
           
static JbbSqlClause newInstance()
           
 void setLogicalOperatorAND(boolean logicalOperatorAND)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static JbbSqlClause newInstance()
Returns:
a new instance

addGroup

public void addGroup(String group)
trim, make sure the group is properly enclosed in () and add it to the internal list

Parameters:
group -

getSqlClause

public String getSqlClause()
Returns:
the well formatted sql clause

isLogicalOperatorAND

public boolean isLogicalOperatorAND()
Returns:
Returns the logicalOperatorAND.

setLogicalOperatorAND

public void setLogicalOperatorAND(boolean logicalOperatorAND)
Parameters:
logicalOperatorAND - The logicalOperatorAND to set.


Copyright © 2001-2008 Quadrique Corporation. All Rights Reserved.