|
PAJES 3.0.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pajes.db.entity.JoinScope
public class JoinScope
Creates an ON clause suitable for use in a SQL join.
The clause is built up by applying the and() and or() methods, followed by the appropriate comparison methods (compare(), between() and isNull()). For example:
JoinScope clause = new JoinScope().join("primaryTable.colA", JoinScope.EQ, "joinTable.colA").and().join("primaryTable.colB", JoinScope.EQ, "joinTable.colB");
System.out.println(clause.getOnClause());
Scope| Constructor Summary | |
|---|---|
JoinScope()
Creates an ON clause suitable for use with a SQL join. |
|
JoinScope(java.lang.String leftTableAlias)
Creates an ON clause suitable for use with a SQL join. |
|
JoinScope(java.lang.String leftTableAlias,
java.lang.String rightTableAlias)
Creates an ON clause suitable for use with a SQL join. |
|
| Method Summary | |
|---|---|
JoinScope |
and()
Appends an AND statement. |
JoinScope |
compare(java.lang.String columnName,
java.lang.String operator,
java.lang.Object value)
Appends the specified comparison. |
java.lang.String |
getLeftTableAlias()
Returns the left table alias. |
java.lang.Object[] |
getParameters()
Returns the join parameters that can be substituted into the join clause. |
java.lang.String |
getRightTableAlias()
Returns the right table alias. |
boolean |
isLeftTableAliasUsed()
Determines whether the alias will be
automatically prepended to the leftColumnName in the
join(java.lang.String, java.lang.String) methods. |
boolean |
isRightTableAliasUsed()
Determines whether the alias will be
automatically prepended to the rightColumnName in the
join(java.lang.String, java.lang.String) methods. |
JoinScope |
join(java.lang.String leftColumnName,
java.lang.String rightColumnName)
Appends the specified equality comparison between two columns. |
JoinScope |
join(java.lang.String leftColumnName,
java.lang.String operator,
java.lang.String rightColumnName)
Appends the specified comparison between two columns. |
JoinScope |
leftBrace()
Appends a left Brace to begin logical statement grouping. |
JoinScope |
or()
Appends an OR statement. |
JoinScope |
rightBrace()
Appends a right Brace to end logical statement grouping. |
void |
setLeftTableAlias(java.lang.String leftTableAlias)
Sets the left table alias. |
void |
setLeftTableAliasUsed(boolean leftTableAliasUsed)
Sets whether the alias will be automatically
prepended to the leftColumnName in the join(java.lang.String, java.lang.String)
methods. |
void |
setRightTableAlias(java.lang.String rightTableAlias)
Sets the right table alias. |
void |
setRightTableAliasUsed(boolean rightTableAliasUsed)
Sets whether the alias will be automatically
prepended to the rightColumnName in the join(java.lang.String, java.lang.String)
methods. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JoinScope()
public JoinScope(java.lang.String leftTableAlias)
leftTableAlias - the left table alias.
public JoinScope(java.lang.String leftTableAlias,
java.lang.String rightTableAlias)
leftTableAlias - the left table alias.rightTableAlias - the right table alias.| Method Detail |
|---|
public JoinScope and()
public JoinScope compare(java.lang.String columnName,
java.lang.String operator,
java.lang.Object value)
columnName - the name of the column.operator - the comparison operator.value - the comparison value.
public java.lang.String getLeftTableAlias()
public java.lang.Object[] getParameters()
public java.lang.String getRightTableAlias()
public boolean isLeftTableAliasUsed()
alias will be
automatically prepended to the leftColumnName in the
join(java.lang.String, java.lang.String) methods.
public boolean isRightTableAliasUsed()
alias will be
automatically prepended to the rightColumnName in the
join(java.lang.String, java.lang.String) methods.
public JoinScope join(java.lang.String leftColumnName,
java.lang.String rightColumnName)
leftColumnName - the name of the column on the left of the comparison.rightColumnName - the name of the column on the right of the comparison.
public JoinScope join(java.lang.String leftColumnName,
java.lang.String operator,
java.lang.String rightColumnName)
leftColumnName - the name of the column on the left of the comparison.operator - the comparison operator.rightColumnName - the name of the column on the right of the comparison.
public JoinScope leftBrace()
public JoinScope or()
public JoinScope rightBrace()
public void setLeftTableAlias(java.lang.String leftTableAlias)
set whether it is used or not
leftTableAlias - the left table alias.public void setLeftTableAliasUsed(boolean leftTableAliasUsed)
alias will be automatically
prepended to the leftColumnName in the join(java.lang.String, java.lang.String)
methods.
leftTableAliasUsed - true if the left table alias will be automtically used.public void setRightTableAlias(java.lang.String rightTableAlias)
set whether it is used or
not
rightTableAlias - The rightTableAlias to setpublic void setRightTableAliasUsed(boolean rightTableAliasUsed)
alias will be automatically
prepended to the rightColumnName in the join(java.lang.String, java.lang.String)
methods.
rightTableAliasUsed - true if the right table alias will be automtically used.public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
PAJES 3.0.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||