org.openanzo.sqlscribe
Class Join

java.lang.Object
  extended by org.openanzo.sqlscribe.Match
      extended by org.openanzo.sqlscribe.Join
All Implemented Interfaces:
Constraint

public class Join
extends Match
implements Constraint

Join between two tables. For example, "WHERE table1.id = table2.foreignKeyId" is a simple foreign key join between table1 and table2.

Author:
Joe Betz

Constructor Summary
Join(Column lhs, java.lang.String operator, Column rhs)
          Create a Join constraint
 
Method Summary
 java.lang.String getConstraint(java.util.List<java.lang.String> unboundVariables)
          Get the SQL text for this constraint, using any variables from the provided list
 Column getRhs()
          Get the column on the right side of the join operation
 java.util.Set<ITable> listTables()
          Get the set of tables to which this constraint is based
 void writeConstraint(java.lang.StringBuffer buf, java.util.List<java.lang.String> unboundVariables)
          Write the SQL text for this constraint to the provided buffer, using any variables from the provided list
 
Methods inherited from class org.openanzo.sqlscribe.Match
equals, equals, getLhs, getOperator, greater, greater, in, isNotNull, isNull, less, less, varEquals, varGreater, varGreaterEquals, varLess, varLessEquals
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Join

public Join(Column lhs,
            java.lang.String operator,
            Column rhs)
Create a Join constraint

Parameters:
lhs - column on left side of join operator
operator - operator to use to join the 2 columns
rhs - column on right side of join operator
Method Detail

getConstraint

public java.lang.String getConstraint(java.util.List<java.lang.String> unboundVariables)
Description copied from interface: Constraint
Get the SQL text for this constraint, using any variables from the provided list

Specified by:
getConstraint in interface Constraint
Parameters:
unboundVariables - set of variables that can be used within constraints
Returns:
the SQL text for this constraint, using any variables from the provided list

writeConstraint

public void writeConstraint(java.lang.StringBuffer buf,
                            java.util.List<java.lang.String> unboundVariables)
Description copied from interface: Constraint
Write the SQL text for this constraint to the provided buffer, using any variables from the provided list

Specified by:
writeConstraint in interface Constraint
Parameters:
buf - StringBuffer to which the SQL text for this constraint is appended
unboundVariables - set of variables that can be used within constraints

getRhs

public Column getRhs()
Get the column on the right side of the join operation

Returns:
the column on the right side of the join operation

listTables

public java.util.Set<ITable> listTables()
Description copied from interface: Constraint
Get the set of tables to which this constraint is based

Specified by:
listTables in interface Constraint
Overrides:
listTables in class Match
Returns:
the set of tables to which this constraint is based


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.