public abstract class JoinFragment extends Object
An abstract SQL join fragment renderer
Modifier and Type | Field and Description |
---|---|
static int |
FULL_JOIN
Deprecated.
use
JoinType.FULL_JOIN instead. |
static int |
INNER_JOIN
Deprecated.
use
JoinType.INNER_JOIN instead. |
static int |
LEFT_OUTER_JOIN
Deprecated.
use
JoinType.LEFT_OUTER_JOIN instead. |
static int |
RIGHT_OUTER_JOIN
Deprecated.
use
JoinType.RIGHT_OUTER_JOIN instead. |
Constructor and Description |
---|
JoinFragment() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
addCondition(String condition)
Adds a free-form condition fragment
|
protected boolean |
addCondition(StringBuilder buffer,
String on)
Appends the 'on' condition to the buffer, returning true if the condition was added.
|
abstract void |
addCondition(String alias,
String[] fkColumns,
String[] pkColumns)
Adds a condition to the join fragment.
|
abstract void |
addCrossJoin(String tableName,
String alias)
Adds a cross join to the specified table.
|
void |
addFragment(JoinFragment ojf)
Adds another join fragment to this one.
|
void |
addJoin(String tableName,
String alias,
String[][] fkColumns,
String[] pkColumns,
JoinType joinType,
String on)
Adds a join, with an additional ON clause fragment
|
abstract void |
addJoin(String tableName,
String alias,
String[] fkColumns,
String[] pkColumns,
JoinType joinType)
Adds a join.
|
abstract void |
addJoin(String tableName,
String alias,
String[] fkColumns,
String[] pkColumns,
JoinType joinType,
String on)
Adds a join, with an additional ON clause fragment
|
abstract void |
addJoins(String fromFragment,
String whereFragment)
Free-form form of adding theta-style joins taking the necessary FROM and WHERE clause fragments
|
abstract JoinFragment |
copy()
Make a copy.
|
boolean |
hasFilterCondition()
True if the where fragment is from a filter condition.
|
boolean |
hasThetaJoins()
Determine if the join fragment contained any theta-joins.
|
void |
setHasFilterCondition(boolean b) |
void |
setHasThetaJoins(boolean hasThetaJoins) |
abstract String |
toFromFragmentString()
Render this fragment to its FROM clause portion
|
abstract String |
toWhereFragmentString()
Render this fragment to its WHERE clause portion
|
@Deprecated public static final int INNER_JOIN
JoinType.INNER_JOIN
instead.Specifies an inner join.
@Deprecated public static final int FULL_JOIN
JoinType.FULL_JOIN
instead.Specifies a full join
@Deprecated public static final int LEFT_OUTER_JOIN
JoinType.LEFT_OUTER_JOIN
instead.Specifies a left join.
@Deprecated public static final int RIGHT_OUTER_JOIN
JoinType.RIGHT_OUTER_JOIN
instead.Specifies a right join.
public abstract void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, JoinType joinType)
Adds a join.
tableName
- The name of the table to be joinedalias
- The alias to apply to the joined tablefkColumns
- The names of the columns which reference the joined tablepkColumns
- The columns in the joined table being referencedjoinType
- The type of joinpublic abstract void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, JoinType joinType, String on)
Adds a join, with an additional ON clause fragment
tableName
- The name of the table to be joinedalias
- The alias to apply to the joined tablefkColumns
- The names of the columns which reference the joined tablepkColumns
- The columns in the joined table being referencedjoinType
- The type of joinon
- The additional ON fragmentpublic void addJoin(String tableName, String alias, String[][] fkColumns, String[] pkColumns, JoinType joinType, String on)
Adds a join, with an additional ON clause fragment
tableName
- The name of the table to be joinedalias
- The alias to apply to the joined tablefkColumns
- The names of the columns which reference the joined tablepkColumns
- The columns in the joined table being referencedjoinType
- The type of joinon
- The additional ON fragmentpublic abstract void addCrossJoin(String tableName, String alias)
Adds a cross join to the specified table.
tableName
- The name of the table to be joinedalias
- The alias to apply to the joined tablepublic abstract void addJoins(String fromFragment, String whereFragment)
Free-form form of adding theta-style joins taking the necessary FROM and WHERE clause fragments
fromFragment
- The FROM clause fragmentwhereFragment
- The WHERE clause fragmentpublic abstract String toFromFragmentString()
Render this fragment to its FROM clause portion
public abstract String toWhereFragmentString()
Render this fragment to its WHERE clause portion
public abstract void addCondition(String alias, String[] fkColumns, String[] pkColumns)
Adds a condition to the join fragment.
alias
- The alias of the joined tablefkColumns
- The names of the columns which reference the joined tablepkColumns
- The columns in the joined table being referencedpublic abstract boolean addCondition(String condition)
Adds a free-form condition fragment
condition
- The fragmenttrue
if the condition was addedpublic abstract JoinFragment copy()
Make a copy.
public void addFragment(JoinFragment ojf)
Adds another join fragment to this one.
ojf
- The other join fragmentprotected boolean addCondition(StringBuilder buffer, String on)
Appends the 'on' condition to the buffer, returning true if the condition was added. Returns false if the 'on' condition was empty.
buffer
- The buffer to append the 'on' condition to.on
- The 'on' condition.public boolean hasFilterCondition()
True if the where fragment is from a filter condition.
public void setHasFilterCondition(boolean b)
public boolean hasThetaJoins()
Determine if the join fragment contained any theta-joins.
true
if the fragment contained theta joinspublic void setHasThetaJoins(boolean hasThetaJoins)
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.