com.onewebsql.query
Class Join

java.lang.Object
  extended by com.onewebsql.query.Join
All Implemented Interfaces:
Expression, TableReference

public class Join
extends Object
implements TableReference

Represents a JOIN of two TableReferences.


Field Summary
protected  LExp condition
          Join where condition
static String CROSS_JOIN
          Constant used to build a query.
static String FULL_JOIN
          Constant used to build a query.
static String JOIN
          Constant used to build a query.
protected  String joinType
          Join type
static String LEFT_JOIN
          Constant used to build a query.
protected  String leftAlias
          Alias of the left table reference
protected  TableReference leftTableReference
          Left table reference used in this join.
static String NATURAL_CROSS_JOIN
          Constant used to build a query.
static String NATURAL_FULL_JOIN
          Constant used to build a query.
static String NATURAL_JOIN
          Constant used to build a query.
static String NATURAL_LEFT_JOIN
          Constant used to build a query.
static String NATURAL_RIGHT_JOIN
          Constant used to build a query.
static String ON
          Constant used to build a query.
static String RIGHT_JOIN
          Constant used to build a query.
protected  String rightAlias
          Alias of the right table reference
protected  TableReference rightTableReference
          Right table reference used in this join.
 
Fields inherited from interface com.onewebsql.query.Expression
COMMA, DOT, LB, QUESTION_MARK, RB, SPACE
 
Constructor Summary
protected Join(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias, String joinType, LExp condition)
          Constructor.
 
Method Summary
 void build(StringBuilder sb, String schemaName, List<Value> objs, DBAdapter adapter)
          Builds the join text.
static Join crossJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference)
          Creates a CROSS JOIN of two table references with the specified WHERE condition and alias for the left reference.
static Join crossJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias)
          Creates a CROSS JOIN of two table references with the specified WHERE condition and aliases for the both references.
static Join crossJoin(TableReference leftTableReference, TableReference rightTableReference)
          Creates a CROSS JOIN of two table references with the specified WHERE condition and no aliases.
static Join crossJoin(TableReference leftTableReference, TableReference rightTableReference, String rightAlias)
          Creates a CROSS JOIN of two table references with the specified WHERE condition and alias for the right reference.
 boolean equals(Object obj)
           
static Join fullJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, LExp condition)
          Creates a FULL JOIN of two table references with the specified WHERE condition and alias for the left reference.
static Join fullJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias, LExp condition)
          Creates a FULL JOIN of two table references with the specified WHERE condition and aliases for the both references.
static Join fullJoin(TableReference leftTableReference, TableReference rightTableReference, LExp condition)
          Creates a FULL JOIN of two table references with the specified WHERE condition and no aliases.
static Join fullJoin(TableReference leftTableReference, TableReference rightTableReference, String rightAlias, LExp condition)
          Creates a FULL JOIN of two table references with the specified WHERE condition and alias for the right reference.
 List<Column> getColumns()
          Returns the list of columns in both tables of this join
 LExp getCondition()
          Returns the join WHERE condition
 String getJoinType()
          Returns the JOIN type.
 String getLeftAlias()
          Returns alias of the left table reference
 TableReference getLeftTableReference()
          Returns left table reference used in this join.
 String getRightAlias()
          Returns alias of the right table reference
 TableReference getRightTableReference()
          Returns right table reference used in this join.
 int hashCode()
           
static Join join(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, LExp condition)
          Creates a JOIN of two table references with the specified WHERE condition and alias for the left reference.
static Join join(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias, LExp condition)
          Creates a JOIN of two table references with the specified WHERE condition and aliases for the both references.
static Join join(TableReference leftTableReference, TableReference rightTableReference, LExp condition)
          Creates a JOIN of two table references with the specified WHERE condition and no aliases.
static Join join(TableReference leftTableReference, TableReference rightTableReference, String rightAlias, LExp condition)
          Creates a JOIN of two table references with the specified WHERE condition and alias for the right reference.
static Join leftJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, LExp condition)
          Creates a LEFT JOIN of two table references with the specified WHERE condition and alias for the left reference.
static Join leftJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias, LExp condition)
          Creates a LEFT JOIN of two table references with the specified WHERE condition and aliases for the both references.
static Join leftJoin(TableReference leftTableReference, TableReference rightTableReference, LExp condition)
          Creates a LEFT JOIN of two table references with the specified WHERE condition and no aliases.
static Join leftJoin(TableReference leftTableReference, TableReference rightTableReference, String rightAlias, LExp condition)
          Creates a LEFT JOIN of two table references with the specified WHERE condition and alias for the right reference.
static Join naturalCrossJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference)
          Creates a NATURAL CROSS JOIN of two table references with the specified alias for the left reference.
static Join naturalCrossJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias)
          Creates a NATURAL CROSS JOIN of two table references with the specified aliases for both references.
static Join naturalCrossJoin(TableReference leftTableReference, TableReference rightTableReference)
          Creates a NATURAL CROSS JOIN of two table references with no aliases.
static Join naturalCrossJoin(TableReference leftTableReference, TableReference rightTableReference, String rightAlias)
          Creates a NATURAL CROSS JOIN of two table references with the specified alias for the right reference.
static Join naturalFullJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference)
          Creates a NATURAL FULL JOIN of two table references with the specified alias for the left reference.
static Join naturalFullJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias)
          Creates a NATURAL FULL JOIN of two table references with the specified aliases for both references.
static Join naturalFullJoin(TableReference leftTableReference, TableReference rightTableReference)
          Creates a NATURAL FULL JOIN of two table references with no aliases.
static Join naturalFullJoin(TableReference leftTableReference, TableReference rightTableReference, String rightAlias)
          Creates a NATURAL FULL JOIN of two table references with the specified alias for the right reference.
static Join naturalJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference)
          Creates a NATURAL JOIN of two table references with the specified alias for the left reference.
static Join naturalJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias)
          Creates a NATURAL JOIN of two table references with the specified aliases for both references.
static Join naturalJoin(TableReference leftTableReference, TableReference rightTableReference)
          Creates a NATURAL JOIN of two table references with no aliases.
static Join naturalJoin(TableReference leftTableReference, TableReference rightTableReference, String rightAlias)
          Creates a NATURAL JOIN of two table references with the specified alias for the right reference.
static Join naturalLeftJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference)
          Creates a NATURAL LEFT JOIN of two table references with the specified alias for the left reference.
static Join naturalLeftJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias)
          Creates a NATURAL LEFT JOIN of two table references with the specified aliases for both references.
static Join naturalLeftJoin(TableReference leftTableReference, TableReference rightTableReference)
          Creates a NATURAL LEFT JOIN of two table references with no aliases.
static Join naturalLeftJoin(TableReference leftTableReference, TableReference rightTableReference, String rightAlias)
          Creates a NATURAL LEFT JOIN of two table references with the specified alias for the right reference.
static Join naturalRightJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference)
          Creates a NATURAL RIGHT JOIN of two table references with the specified alias for the left reference.
static Join naturalRightJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias)
          Creates a NATURAL RIGHT JOIN of two table references with the specified aliases for both references.
static Join naturalRightJoin(TableReference leftTableReference, TableReference rightTableReference)
          Creates a NATURAL RIGHT JOIN of two table references with no aliases.
static Join naturalRightJoin(TableReference leftTableReference, TableReference rightTableReference, String rightAlias)
          Creates a NATURAL RIGHT JOIN of two table references with the specified alias for the right reference.
static Join rightJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, LExp condition)
          Creates a RIGHT JOIN of two table references with the specified WHERE condition and alias for the left reference.
static Join rightJoin(TableReference leftTableReference, String leftAlias, TableReference rightTableReference, String rightAlias, LExp condition)
          Creates a RIGHT JOIN of two table references with the specified WHERE condition and aliases for the both references.
static Join rightJoin(TableReference leftTableReference, TableReference rightTableReference, LExp condition)
          Creates a RIGHT JOIN of two table references with the specified WHERE condition and no aliases.
static Join rightJoin(TableReference leftTableReference, TableReference rightTableReference, String rightAlias, LExp condition)
          Creates a RIGHT JOIN of two table references with the specified WHERE condition and alias for the right reference.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ON

public static final String ON
Constant used to build a query.

See Also:
Constant Field Values

NATURAL_JOIN

public static final String NATURAL_JOIN
Constant used to build a query.

See Also:
Constant Field Values

JOIN

public static final String JOIN
Constant used to build a query.

See Also:
Constant Field Values

NATURAL_LEFT_JOIN

public static final String NATURAL_LEFT_JOIN
Constant used to build a query.

See Also:
Constant Field Values

LEFT_JOIN

public static final String LEFT_JOIN
Constant used to build a query.

See Also:
Constant Field Values

NATURAL_RIGHT_JOIN

public static final String NATURAL_RIGHT_JOIN
Constant used to build a query.

See Also:
Constant Field Values

RIGHT_JOIN

public static final String RIGHT_JOIN
Constant used to build a query.

See Also:
Constant Field Values

NATURAL_CROSS_JOIN

public static final String NATURAL_CROSS_JOIN
Constant used to build a query.

See Also:
Constant Field Values

CROSS_JOIN

public static final String CROSS_JOIN
Constant used to build a query.

See Also:
Constant Field Values

NATURAL_FULL_JOIN

public static final String NATURAL_FULL_JOIN
Constant used to build a query.

See Also:
Constant Field Values

FULL_JOIN

public static final String FULL_JOIN
Constant used to build a query.

See Also:
Constant Field Values

leftTableReference

protected TableReference leftTableReference
Left table reference used in this join.


leftAlias

protected String leftAlias
Alias of the left table reference


rightTableReference

protected TableReference rightTableReference
Right table reference used in this join.


rightAlias

protected String rightAlias
Alias of the right table reference


joinType

protected String joinType
Join type


condition

protected LExp condition
Join where condition

Constructor Detail

Join

protected Join(TableReference leftTableReference,
               String leftAlias,
               TableReference rightTableReference,
               String rightAlias,
               String joinType,
               LExp condition)
Constructor.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
joinType - join type
condition - join where condition
Method Detail

getCondition

public LExp getCondition()
Returns the join WHERE condition

Returns:
join WHERE condition

getJoinType

public String getJoinType()
Returns the JOIN type.

Returns:
JOIN type

getLeftAlias

public String getLeftAlias()
Returns alias of the left table reference

Returns:
alias of the left table reference

getLeftTableReference

public TableReference getLeftTableReference()
Returns left table reference used in this join.

Returns:
left table reference used in this join.

getRightAlias

public String getRightAlias()
Returns alias of the right table reference

Returns:
alias of the right table reference

getRightTableReference

public TableReference getRightTableReference()
Returns right table reference used in this join.

Returns:
right table reference used in this join.

naturalJoin

public static Join naturalJoin(TableReference leftTableReference,
                               String leftAlias,
                               TableReference rightTableReference,
                               String rightAlias)
Creates a NATURAL JOIN of two table references with the specified aliases for both references.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
Returns:
a NATURAL JOIN of two table references with the specified aliases for both references

naturalJoin

public static Join naturalJoin(TableReference leftTableReference,
                               String leftAlias,
                               TableReference rightTableReference)
Creates a NATURAL JOIN of two table references with the specified alias for the left reference.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
Returns:
a NATURAL JOIN of two table references with the specified alias for the left reference

naturalJoin

public static Join naturalJoin(TableReference leftTableReference,
                               TableReference rightTableReference,
                               String rightAlias)
Creates a NATURAL JOIN of two table references with the specified alias for the right reference.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
rightAlias - alias of the left table reference
Returns:
a NATURAL JOIN of two table references with the specified alias for the right reference

naturalJoin

public static Join naturalJoin(TableReference leftTableReference,
                               TableReference rightTableReference)
Creates a NATURAL JOIN of two table references with no aliases.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
Returns:
a NATURAL JOIN of two table references

join

public static Join join(TableReference leftTableReference,
                        String leftAlias,
                        TableReference rightTableReference,
                        String rightAlias,
                        LExp condition)
Creates a JOIN of two table references with the specified WHERE condition and aliases for the both references.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
condition - WHERE condition
Returns:
a JOIN of two table references with the specified WHERE condition and aliases for the both references

join

public static Join join(TableReference leftTableReference,
                        String leftAlias,
                        TableReference rightTableReference,
                        LExp condition)
Creates a JOIN of two table references with the specified WHERE condition and alias for the left reference.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
condition - WHERE condition
Returns:
a JOIN of two table references with the specified WHERE condition and alias for the left reference

join

public static Join join(TableReference leftTableReference,
                        TableReference rightTableReference,
                        String rightAlias,
                        LExp condition)
Creates a JOIN of two table references with the specified WHERE condition and alias for the right reference.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
condition - WHERE condition
Returns:
a JOIN of two table references with the specified WHERE condition and alias for the right reference

join

public static Join join(TableReference leftTableReference,
                        TableReference rightTableReference,
                        LExp condition)
Creates a JOIN of two table references with the specified WHERE condition and no aliases.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
condition - WHERE condition
Returns:
a JOIN of two table references with the specified WHERE condition and no aliases

naturalLeftJoin

public static Join naturalLeftJoin(TableReference leftTableReference,
                                   String leftAlias,
                                   TableReference rightTableReference,
                                   String rightAlias)
Creates a NATURAL LEFT JOIN of two table references with the specified aliases for both references.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
Returns:
a NATURAL LEFT JOIN of two table references with the specified aliases for both references

naturalLeftJoin

public static Join naturalLeftJoin(TableReference leftTableReference,
                                   String leftAlias,
                                   TableReference rightTableReference)
Creates a NATURAL LEFT JOIN of two table references with the specified alias for the left reference.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
Returns:
a NATURAL LEFT JOIN of two table references with the specified alias for the left reference

naturalLeftJoin

public static Join naturalLeftJoin(TableReference leftTableReference,
                                   TableReference rightTableReference,
                                   String rightAlias)
Creates a NATURAL LEFT JOIN of two table references with the specified alias for the right reference.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
rightAlias - alias of the left table reference
Returns:
a NATURAL LEFT JOIN of two table references with the specified alias for the right reference

naturalLeftJoin

public static Join naturalLeftJoin(TableReference leftTableReference,
                                   TableReference rightTableReference)
Creates a NATURAL LEFT JOIN of two table references with no aliases.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
Returns:
a NATURAL LEFT JOIN of two table references

leftJoin

public static Join leftJoin(TableReference leftTableReference,
                            String leftAlias,
                            TableReference rightTableReference,
                            String rightAlias,
                            LExp condition)
Creates a LEFT JOIN of two table references with the specified WHERE condition and aliases for the both references.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
condition - WHERE condition
Returns:
a LEFT JOIN of two table references with the specified WHERE condition and aliases for the both references

leftJoin

public static Join leftJoin(TableReference leftTableReference,
                            String leftAlias,
                            TableReference rightTableReference,
                            LExp condition)
Creates a LEFT JOIN of two table references with the specified WHERE condition and alias for the left reference.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
condition - WHERE condition
Returns:
a LEFT JOIN of two table references with the specified WHERE condition and alias for the left reference

leftJoin

public static Join leftJoin(TableReference leftTableReference,
                            TableReference rightTableReference,
                            String rightAlias,
                            LExp condition)
Creates a LEFT JOIN of two table references with the specified WHERE condition and alias for the right reference.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
condition - WHERE condition
Returns:
a LEFT JOIN of two table references with the specified WHERE condition and alias for the right reference

leftJoin

public static Join leftJoin(TableReference leftTableReference,
                            TableReference rightTableReference,
                            LExp condition)
Creates a LEFT JOIN of two table references with the specified WHERE condition and no aliases.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
condition - WHERE condition
Returns:
a LEFT JOIN of two table references with the specified WHERE condition and no aliases

naturalRightJoin

public static Join naturalRightJoin(TableReference leftTableReference,
                                    String leftAlias,
                                    TableReference rightTableReference,
                                    String rightAlias)
Creates a NATURAL RIGHT JOIN of two table references with the specified aliases for both references.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
Returns:
a NATURAL RIGHT JOIN of two table references with the specified aliases for both references

naturalRightJoin

public static Join naturalRightJoin(TableReference leftTableReference,
                                    String leftAlias,
                                    TableReference rightTableReference)
Creates a NATURAL RIGHT JOIN of two table references with the specified alias for the left reference.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
Returns:
a NATURAL RIGHT JOIN of two table references with the specified alias for the left reference

naturalRightJoin

public static Join naturalRightJoin(TableReference leftTableReference,
                                    TableReference rightTableReference,
                                    String rightAlias)
Creates a NATURAL RIGHT JOIN of two table references with the specified alias for the right reference.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
rightAlias - alias of the left table reference
Returns:
a NATURAL RIGHT JOIN of two table references with the specified alias for the right reference

naturalRightJoin

public static Join naturalRightJoin(TableReference leftTableReference,
                                    TableReference rightTableReference)
Creates a NATURAL RIGHT JOIN of two table references with no aliases.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
Returns:
a NATURAL RIGHT JOIN of two table references

rightJoin

public static Join rightJoin(TableReference leftTableReference,
                             String leftAlias,
                             TableReference rightTableReference,
                             String rightAlias,
                             LExp condition)
Creates a RIGHT JOIN of two table references with the specified WHERE condition and aliases for the both references.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
condition - WHERE condition
Returns:
a RIGHT JOIN of two table references with the specified WHERE condition and aliases for the both references

rightJoin

public static Join rightJoin(TableReference leftTableReference,
                             String leftAlias,
                             TableReference rightTableReference,
                             LExp condition)
Creates a RIGHT JOIN of two table references with the specified WHERE condition and alias for the left reference.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
condition - WHERE condition
Returns:
a RIGHT JOIN of two table references with the specified WHERE condition and alias for the left reference

rightJoin

public static Join rightJoin(TableReference leftTableReference,
                             TableReference rightTableReference,
                             String rightAlias,
                             LExp condition)
Creates a RIGHT JOIN of two table references with the specified WHERE condition and alias for the right reference.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
condition - WHERE condition
Returns:
a RIGHT JOIN of two table references with the specified WHERE condition and alias for the right reference

rightJoin

public static Join rightJoin(TableReference leftTableReference,
                             TableReference rightTableReference,
                             LExp condition)
Creates a RIGHT JOIN of two table references with the specified WHERE condition and no aliases.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
condition - WHERE condition
Returns:
a RIGHT JOIN of two table references with the specified WHERE condition and no aliases

naturalCrossJoin

public static Join naturalCrossJoin(TableReference leftTableReference,
                                    String leftAlias,
                                    TableReference rightTableReference,
                                    String rightAlias)
Creates a NATURAL CROSS JOIN of two table references with the specified aliases for both references.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
Returns:
a NATURAL CROSS JOIN of two table references with the specified aliases for both references

naturalCrossJoin

public static Join naturalCrossJoin(TableReference leftTableReference,
                                    String leftAlias,
                                    TableReference rightTableReference)
Creates a NATURAL CROSS JOIN of two table references with the specified alias for the left reference.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
Returns:
a NATURAL CROSS JOIN of two table references with the specified alias for the left reference

naturalCrossJoin

public static Join naturalCrossJoin(TableReference leftTableReference,
                                    TableReference rightTableReference,
                                    String rightAlias)
Creates a NATURAL CROSS JOIN of two table references with the specified alias for the right reference.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
rightAlias - alias of the left table reference
Returns:
a NATURAL CROSS JOIN of two table references with the specified alias for the right reference

naturalCrossJoin

public static Join naturalCrossJoin(TableReference leftTableReference,
                                    TableReference rightTableReference)
Creates a NATURAL CROSS JOIN of two table references with no aliases.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
Returns:
a NATURAL CROSS JOIN of two table references

crossJoin

public static Join crossJoin(TableReference leftTableReference,
                             String leftAlias,
                             TableReference rightTableReference,
                             String rightAlias)
Creates a CROSS JOIN of two table references with the specified WHERE condition and aliases for the both references.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
Returns:
a CROSS JOIN of two table references with the specified WHERE condition and aliases for the both references

crossJoin

public static Join crossJoin(TableReference leftTableReference,
                             String leftAlias,
                             TableReference rightTableReference)
Creates a CROSS JOIN of two table references with the specified WHERE condition and alias for the left reference.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
Returns:
a CROSS JOIN of two table references with the specified WHERE condition and alias for the left reference

crossJoin

public static Join crossJoin(TableReference leftTableReference,
                             TableReference rightTableReference,
                             String rightAlias)
Creates a CROSS JOIN of two table references with the specified WHERE condition and alias for the right reference.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
Returns:
a CROSS JOIN of two table references with the specified WHERE condition and alias for the right reference

crossJoin

public static Join crossJoin(TableReference leftTableReference,
                             TableReference rightTableReference)
Creates a CROSS JOIN of two table references with the specified WHERE condition and no aliases.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
Returns:
a CROSS JOIN of two table references with the specified WHERE condition and no aliases

naturalFullJoin

public static Join naturalFullJoin(TableReference leftTableReference,
                                   String leftAlias,
                                   TableReference rightTableReference,
                                   String rightAlias)
Creates a NATURAL FULL JOIN of two table references with the specified aliases for both references.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
Returns:
a NATURAL CROSS JOIN of two table references with the specified aliases for both references

naturalFullJoin

public static Join naturalFullJoin(TableReference leftTableReference,
                                   String leftAlias,
                                   TableReference rightTableReference)
Creates a NATURAL FULL JOIN of two table references with the specified alias for the left reference.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
Returns:
a NATURAL FULL JOIN of two table references with the specified alias for the left reference

naturalFullJoin

public static Join naturalFullJoin(TableReference leftTableReference,
                                   TableReference rightTableReference,
                                   String rightAlias)
Creates a NATURAL FULL JOIN of two table references with the specified alias for the right reference.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
rightAlias - alias of the left table reference
Returns:
a NATURAL FULL JOIN of two table references with the specified alias for the right reference

naturalFullJoin

public static Join naturalFullJoin(TableReference leftTableReference,
                                   TableReference rightTableReference)
Creates a NATURAL FULL JOIN of two table references with no aliases.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
Returns:
a NATURAL FULL JOIN of two table references

fullJoin

public static Join fullJoin(TableReference leftTableReference,
                            String leftAlias,
                            TableReference rightTableReference,
                            String rightAlias,
                            LExp condition)
Creates a FULL JOIN of two table references with the specified WHERE condition and aliases for the both references.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
condition - WHERE condition
Returns:
a FULL JOIN of two table references with the specified WHERE condition and aliases for the both references

fullJoin

public static Join fullJoin(TableReference leftTableReference,
                            String leftAlias,
                            TableReference rightTableReference,
                            LExp condition)
Creates a FULL JOIN of two table references with the specified WHERE condition and alias for the left reference.

Parameters:
leftTableReference - left table reference used in this join
leftAlias - alias of the left table reference
rightTableReference - right table reference used in this join
condition - WHERE condition
Returns:
a FULL JOIN of two table references with the specified WHERE condition and alias for the left reference

fullJoin

public static Join fullJoin(TableReference leftTableReference,
                            TableReference rightTableReference,
                            String rightAlias,
                            LExp condition)
Creates a FULL JOIN of two table references with the specified WHERE condition and alias for the right reference.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
rightAlias - alias of the right table reference
condition - WHERE condition
Returns:
a FULL JOIN of two table references with the specified WHERE condition and alias for the right reference

fullJoin

public static Join fullJoin(TableReference leftTableReference,
                            TableReference rightTableReference,
                            LExp condition)
Creates a FULL JOIN of two table references with the specified WHERE condition and no aliases.

Parameters:
leftTableReference - left table reference used in this join
rightTableReference - right table reference used in this join
condition - WHERE condition
Returns:
a FULL JOIN of two table references with the specified WHERE condition and no aliases

getColumns

public List<Column> getColumns()
Returns the list of columns in both tables of this join

Specified by:
getColumns in interface TableReference
Returns:
list of columns of this table expression

build

public void build(StringBuilder sb,
                  String schemaName,
                  List<Value> objs,
                  DBAdapter adapter)
Builds the join text. Joins may be built in a way specific for a certain database engine using the method DBAdapter.join(Join, String, StringBuilder, List).

Specified by:
build in interface Expression
Parameters:
sb - StringBuilder to build the query text
schemaName - name of the database schema used to build the query
objs - an accumulator list to which query parameters are appended
adapter - database adapter which builds builds query in a way specific to the database engine

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011-2013 e-point SA. All Rights Reserved.