public final class JoiningSet extends Object implements Serializable, Cloneable
For example,
FROM table_a LEFT OUTER JOIN table_b ON ( table_a.id = table_b.id ), ...
A ',' should donate an INNER_JOIN in an SQL FROM clause.
Modifier and Type | Class and Description |
---|---|
static class |
JoiningSet.JoinPart |
Modifier and Type | Field and Description |
---|---|
static int |
FULL_OUTER_JOIN |
static int |
INNER_JOIN
Statics for Join Types.
|
static int |
LEFT_OUTER_JOIN |
static int |
RIGHT_OUTER_JOIN |
Constructor and Description |
---|
JoiningSet()
Constructs the JoiningSet.
|
Modifier and Type | Method and Description |
---|---|
void |
addJoin(int type)
Adds a joining type to the set with no 'on' expression.
|
void |
addJoin(int type,
Expression on_expression)
Adds a joining type to the set, and an 'on' expression.
|
void |
addPreviousJoin(int type,
Expression on_expression)
Hack, add a joining type to the previous entry from the end.
|
void |
addTable(TableName table_name)
Adds a new table into the set being joined.
|
Object |
clone()
Performs a deep clone on this object.
|
TableName |
getFirstTable()
Returns the first table in the join set.
|
int |
getJoinType(int n)
Returns the type of join after table 'n' in the set.
|
Expression |
getOnExpression(int n)
Returns the ON Expression for the type of join after table 'n' in the
set.
|
TableName |
getTable(int n)
Returns table 'n' in the result set where table 0 is the first table in
the join set.
|
int |
getTableCount()
Returns the number of tables that are in this set.
|
void |
prepare(DatabaseConnection connection)
Resolves the schema of tables in this joining set.
|
public static final int INNER_JOIN
public static final int LEFT_OUTER_JOIN
public static final int RIGHT_OUTER_JOIN
public static final int FULL_OUTER_JOIN
public void prepare(DatabaseConnection connection)
public void addTable(TableName table_name)
public void addPreviousJoin(int type, Expression on_expression)
public void addJoin(int type, Expression on_expression)
public void addJoin(int type)
public int getTableCount()
public TableName getFirstTable()
public TableName getTable(int n)
public int getJoinType(int n)
String table1 = joins.getFirstTable(); for (int i = 0; i < joins.getTableCount() - 1; ++i) { int type = joins.getJoinType(i); String table2 = getTable(i + 1); // ... Join table1 and table2 ... table1 = table2; }
public Expression getOnExpression(int n)
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 2015. All rights reserved.