com.im.commons.db 5.9.2

com.im.commons.db.dml
Class SQLWhereClauseCompositeElement

java.lang.Object
  extended by com.im.commons.db.dml.SQLWhereClauseCompositeElement
All Implemented Interfaces:
SQLWhereClauseElement

public class SQLWhereClauseCompositeElement
extends Object
implements SQLWhereClauseElement


Nested Class Summary
static class SQLWhereClauseCompositeElement.Type
           
 
Constructor Summary
protected SQLWhereClauseCompositeElement(SQLWhereClauseCompositeElement.Type type)
           
protected SQLWhereClauseCompositeElement(SQLWhereClauseCompositeElement.Type type, SQLJoin join)
          Creates a new instance of SQLWhereCompositeElement
 
Method Summary
 SQLWhereClauseElement addElement(SQLWhereClauseElement el)
          Add a new element to the exisitng terms in this element.
 SQLWhereClauseElement addElement(SQLWhereClauseElement term, SQLWhereClauseCompositeElement.Type type)
          Add the new term, rebuilding this term if necessary.
 void addJoins(Set<SQLJoin> joins)
           
 void addRequiredTables(Set<SchemaQualifiedName> requiredTables)
           
 void appendTo(StringBuffer buf)
          Append the individual filter expression of the where clause
 void appendWhere(StringBuffer buf)
          Appends WHERE plus the individual elements
static SQLWhereClauseCompositeElement createAndClause()
           
static SQLWhereClauseCompositeElement createOrClause()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLWhereClauseCompositeElement

protected SQLWhereClauseCompositeElement(SQLWhereClauseCompositeElement.Type type,
                                         SQLJoin join)
Creates a new instance of SQLWhereCompositeElement


SQLWhereClauseCompositeElement

protected SQLWhereClauseCompositeElement(SQLWhereClauseCompositeElement.Type type)
Method Detail

createAndClause

public static SQLWhereClauseCompositeElement createAndClause()

createOrClause

public static SQLWhereClauseCompositeElement createOrClause()

addElement

public SQLWhereClauseElement addElement(SQLWhereClauseElement term,
                                        SQLWhereClauseCompositeElement.Type type)
Add the new term, rebuilding this term if necessary. This term may become an inner term of the rebuilt expression. The outer most expression is retunred. It is important that you use the new outer term if you want to hold the outer most term.

Specified by:
addElement in interface SQLWhereClauseElement
Parameters:
term -
type -
Returns:
The (possibly new) outer most element

addElement

public SQLWhereClauseElement addElement(SQLWhereClauseElement el)
Add a new element to the exisitng terms in this element. The new element must be from the same table as the existing elements. If not then use the other form of this method.

Parameters:
el -
Returns:
This SQLWhereCompositeElement

addJoins

public void addJoins(Set<SQLJoin> joins)
Specified by:
addJoins in interface SQLWhereClauseElement

appendWhere

public void appendWhere(StringBuffer buf)
Description copied from interface: SQLWhereClauseElement
Appends WHERE plus the individual elements

Specified by:
appendWhere in interface SQLWhereClauseElement

appendTo

public void appendTo(StringBuffer buf)
Description copied from interface: SQLWhereClauseElement
Append the individual filter expression of the where clause

Specified by:
appendTo in interface SQLWhereClauseElement

addRequiredTables

public void addRequiredTables(Set<SchemaQualifiedName> requiredTables)
Specified by:
addRequiredTables in interface SQLWhereClauseElement

toString

public String toString()
Overrides:
toString in class Object

com.im.commons.db 5.9.2