org.apache.ws.jaxme.sqls

Interface CombinedConstraint

public interface CombinedConstraint extends Constraint

Interface of a WHERE or ON clause.
Nested Class Summary
static interfaceCombinedConstraint.Type
Specifies, how the various boolean constraints are combined.
Method Summary
voidaddColumnSetQuery(ColumnSet pSet, TableReference pTableReference)
Adds a check for the columns of the given column set.
voidaddConstraint(Map pMap, Constraint pConstraint)
Clones the given {@link org.apache.ws.jaxme.sqls.Constraint}, mapping the column references from the given constraint to the values in the given map.
voidaddJoin(ForeignKey pKey, TableReference pReferencingTable, TableReference pReferencedTable)
Creates a JOIN condition matching the given foreign key.
voidaddJoin(TableReference pReferencingTable, ColumnSet pReferencingColumnSet, TableReference pReferencedTable, ColumnSet pReferencedColumnSet)
Creates a JOIN condition matching the given column reference.
CombinedConstraintcreateAndConstraint()
Creates an AndConstraint and inserts it at the current position.
BooleanConstraintcreateBETWEEN()
Creates a "BETWEEN" condition with the given select statement and inserts it at the current position.
BooleanConstraintcreateEQ()
Creates an "equals" condition (=) and inserts it at the current position.
voidcreateEXISTS(SelectStatement pStatement)
Creates an "EXISTS" condition with the given select statement and inserts it at the current position.
BooleanConstraintcreateGE()
Creates a "greater or equal" condition (>=) and inserts it at the current position.
BooleanConstraintcreateGT()
Creates a "greater than" condition (>) and inserts it at the current position.
BooleanConstraintcreateIN()
Creates an "IN" condition and inserts it at the current position.
BooleanConstraintcreateISNULL()
Creates an "IS NULL" condition and inserts it at the current position.
BooleanConstraintcreateLE()
Creates a "lower or equal" condition (<=) and inserts it at the current position.
BooleanConstraintcreateLIKE()
Creates a "LIKE" condition and inserts it at the current position.
BooleanConstraintcreateLT()
Creates a "lower than" condition (<) and inserts it at the current position.
BooleanConstraintcreateNE()
Creates a "not equals" condition (<>) and inserts it at the current position.
CombinedConstraintcreateOrConstraint()
Creates an OrConstraint and inserts it at the current position.
intgetNumParts()
Returns the number of parts, that have been added with the various createSomething() methods.
IteratorgetParts()
Returns an Iterator to the parts, that have been added with the various createSomething() methods.
CombinedConstraint.TypegetType()
Returns the type, either of {@link org.apache.ws.jaxme.sqls.CombinedConstraint.Type#AND} or {@link org.apache.ws.jaxme.sqls.CombinedConstraint.Type#OR}.
booleanisNOT()
Returns whether the combined constraint is inverted by adding a prepending NOT.
voidsetNOT(boolean pNOT)
Sets whether the combined constraint is inverted by adding a prepending NOT.

Method Detail

addColumnSetQuery

public 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=?.

addConstraint

public void addConstraint(Map pMap, Constraint pConstraint)
Clones the given {@link org.apache.ws.jaxme.sqls.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.

addJoin

public 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 {@link org.apache.ws.jaxme.sqls.ForeignKey#getTable()} method. pReferencedTable A reference to the table returned by the foreign keys {@link org.apache.ws.jaxme.sqls.ForeignKey#getReferencedTable()} method.

addJoin

public 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 {@link org.apache.ws.jaxme.sqls.ColumnSet} contains the columns A and B, and the referenced column set contains {@link org.apache.ws.jaxme.sqls.ColumnSet}, X and Y, then the following will be added: A=X AND B=Y.

createAndConstraint

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

createBETWEEN

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

createEQ

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

createEXISTS

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

createGE

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

createGT

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

createIN

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

createISNULL

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

createLE

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

createLIKE

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

createLT

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

createNE

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

createOrConstraint

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

getNumParts

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

getParts

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

getType

public CombinedConstraint.Type getType()
Returns the type, either of {@link org.apache.ws.jaxme.sqls.CombinedConstraint.Type#AND} or {@link org.apache.ws.jaxme.sqls.CombinedConstraint.Type#OR}.

isNOT

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

setNOT

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