org.apache.ws.jaxme.sqls
Interface CombinedConstraint

All Superinterfaces:
Constraint
All Known Implementing Classes:
CombinedConstraintImpl

public interface CombinedConstraint
extends Constraint

Interface of a WHERE or ON clause.


Nested Class Summary
static interface CombinedConstraint.Type
          Specifies, how the various boolean constraints are combined.
 
Method Summary
 void addColumnSetQuery(ColumnSet pSet, TableReference pTableReference)
          Adds a check for the columns of the given column set.
 void addConstraint(java.util.Map pMap, Constraint pConstraint)
          Clones the given Constraint, mapping the column references from the given constraint to the values in the given map.
 void addJoin(ForeignKey pKey, TableReference pReferencingTable, TableReference pReferencedTable)
          Creates a JOIN condition matching the given foreign key.
 void addJoin(TableReference pReferencingTable, ColumnSet pReferencingColumnSet, TableReference pReferencedTable, ColumnSet pReferencedColumnSet)
          Creates a JOIN condition matching the given column reference.
 CombinedConstraint createAndConstraint()
          Creates an AndConstraint and inserts it at the current position.
 BooleanConstraint createBETWEEN()
          Creates a "BETWEEN" condition with the given select statement and inserts it at the current position.
 BooleanConstraint createEQ()
          Creates an "equals" condition (=) and inserts it at the current position.
 void createEXISTS(SelectStatement pStatement)
          Creates an "EXISTS" condition with the given select statement and inserts it at the current position.
 BooleanConstraint createGE()
          Creates a "greater or equal" condition (>=) and inserts it at the current position.
 BooleanConstraint createGT()
          Creates a "greater than" condition (>) and inserts it at the current position.
 BooleanConstraint createIN()
          Creates an "IN" condition and inserts it at the current position.
 BooleanConstraint createISNULL()
          Creates an "IS NULL" condition and inserts it at the current position.
 BooleanConstraint createLE()
          Creates a "lower or equal" condition (<=) and inserts it at the current position.
 BooleanConstraint createLIKE()
          Creates a "LIKE" condition and inserts it at the current position.
 BooleanConstraint createLT()
          Creates a "lower than" condition (<) and inserts it at the current position.
 BooleanConstraint createNE()
          Creates a "not equals" condition (<>) and inserts it at the current position.
 CombinedConstraint createOrConstraint()
          Creates an OrConstraint and inserts it at the current position.
 int getNumParts()
          Returns the number of parts, that have been added with the various createSomething() methods.
 java.util.Iterator getParts()
          Returns an Iterator to the parts, that have been added with the various createSomething() methods.
 CombinedConstraint.Type getType()
          Returns the type, either of CombinedConstraint.Type.AND or CombinedConstraint.Type.OR.
 boolean isNOT()
          Returns whether the combined constraint is inverted by adding a prepending NOT.
 void setNOT(boolean pNOT)
          Sets whether the combined constraint is inverted by adding a prepending NOT.
 
Methods inherited from interface org.apache.ws.jaxme.sqls.Constraint
getConstrainedStatement
 

Method Detail

getType

CombinedConstraint.Type getType()
Returns the type, either of CombinedConstraint.Type.AND or CombinedConstraint.Type.OR.


createAndConstraint

CombinedConstraint createAndConstraint()
Creates an AndConstraint and inserts it at the current position.


createOrConstraint

CombinedConstraint createOrConstraint()
Creates an OrConstraint and inserts it at the current position.


createEQ

BooleanConstraint createEQ()
Creates an "equals" condition (=) and inserts it at the current position.


createNE

BooleanConstraint createNE()
Creates a "not equals" condition (<>) and inserts it at the current position.


createLT

BooleanConstraint createLT()
Creates a "lower than" condition (<) and inserts it at the current position.


createGT

BooleanConstraint createGT()
Creates a "greater than" condition (>) and inserts it at the current position.


createLE

BooleanConstraint createLE()
Creates a "lower or equal" condition (<=) and inserts it at the current position.


createGE

BooleanConstraint createGE()
Creates a "greater or equal" condition (>=) and inserts it at the current position.


createLIKE

BooleanConstraint createLIKE()
Creates a "LIKE" condition and inserts it at the current position.


createISNULL

BooleanConstraint createISNULL()
Creates an "IS NULL" condition and inserts it at the current position.


createIN

BooleanConstraint createIN()
Creates an "IN" condition and inserts it at the current position.


createEXISTS

void createEXISTS(SelectStatement pStatement)
Creates an "EXISTS" condition with the given select statement and inserts it at the current position.


createBETWEEN

BooleanConstraint createBETWEEN()
Creates a "BETWEEN" condition with the given select statement and inserts it at the current position.


addJoin

void addJoin(ForeignKey pKey,
             TableReference pReferencingTable,
             TableReference pReferencedTable)
Creates a JOIN condition matching the given foreign key. In other words, if the foreign key consists of the columns A and B referencing the columns X and Y, then the following will be added: A=X AND B=Y.

Parameters:
pKey - The foreign key being matched.
pReferencingTable - A reference to the table returned by the foreign keys ColumnSet.getTable() method.
pReferencedTable - A reference to the table returned by the foreign keys ForeignKey.getReferencedTable() method.

addJoin

void addJoin(TableReference pReferencingTable,
             ColumnSet pReferencingColumnSet,
             TableReference pReferencedTable,
             ColumnSet pReferencedColumnSet)
Creates a JOIN condition matching the given column reference. In other words, if the referencing ColumnSet contains the columns A and B, and the referenced column set contains ColumnSet, X and Y, then the following will be added: A=X AND B=Y.


addConstraint

void addConstraint(java.util.Map pMap,
                   Constraint pConstraint)
Clones the given Constraint, mapping the column references from the given constraint to the values in the given map.

Parameters:
pMap - A Map with the constraints pConstraint table references as keys. The values are table references of the current constraints statement.
pConstraint - The constraint being cloned.

addColumnSetQuery

void addColumnSetQuery(ColumnSet pSet,
                       TableReference pTableReference)
Adds a check for the columns of the given column set. For example, if the column set consists of the columns A and B, then the following will be added: A=? AND B=?.


getNumParts

int getNumParts()
Returns the number of parts, that have been added with the various createSomething() methods.


getParts

java.util.Iterator getParts()
Returns an Iterator to the parts, that have been added with the various createSomething() methods.


isNOT

boolean isNOT()
Returns whether the combined constraint is inverted by adding a prepending NOT.


setNOT

void setNOT(boolean pNOT)
Sets whether the combined constraint is inverted by adding a prepending NOT.