Package org.datanucleus.store.rdbms.sql
Class SQLJoin
java.lang.Object
org.datanucleus.store.rdbms.sql.SQLJoin
Representation of a join in an SQL statement.
The join is of a type (see ANSI SQL), and with inner/left outer/right outer is accompanied by join condition(s),
joining from the source table to the target table via columns.
Additionally other conditions can be applied to restrict the join (such as discriminator).
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BooleanExpression
Optional condition for the join.private SQLTable
The current table that we are joining from to introduce this table.private SQLJoin
Optional sub-join, for when we have JOIN grouping.private SQLTable
Table we are joining to.private SQLJoin.JoinType
Type of join to perform. -
Constructor Summary
ConstructorsConstructorDescriptionSQLJoin
(SQLJoin.JoinType type, SQLTable targetTbl, SQLTable sourceTbl, BooleanExpression condition) Constructor for a join. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Method to update the join "condition" to AND the provided expression.Accessor for the conditions of the join.static SQLJoin.JoinType
getJoinTypeForJoinExpressionType
(org.datanucleus.store.query.expression.JoinExpression.JoinType ejt) Accessor for the table we are joining from.Accessor for the table we are joining to.getType()
void
setSubJoin
(SQLJoin join) void
setType
(SQLJoin.JoinType type) toSQLText
(DatastoreAdapter dba, boolean lock) toString()
-
Field Details
-
type
Type of join to perform. -
targetTable
Table we are joining to. This is always set irrespective the type of join. -
sourceTable
The current table that we are joining from to introduce this table. -
condition
Optional condition for the join. -
subJoin
Optional sub-join, for when we have JOIN grouping.
-
-
Constructor Details
-
SQLJoin
public SQLJoin(SQLJoin.JoinType type, SQLTable targetTbl, SQLTable sourceTbl, BooleanExpression condition) Constructor for a join.- Parameters:
type
- Type of join (one of the defined types in this class).targetTbl
- Target table that we are joining tosourceTbl
- Table we are joining fromcondition
- Join condition
-
-
Method Details
-
getType
-
setType
-
getTargetTable
Accessor for the table we are joining to.- Returns:
- The table joined to
-
getSourceTable
Accessor for the table we are joining from.- Returns:
- The table we join from to bring in this other table
-
getCondition
Accessor for the conditions of the join. These conditions can include- Returns:
- The conditions
-
addAndCondition
Method to update the join "condition" to AND the provided expression.- Parameters:
expr
- The expression to add to the join "condition"
-
setSubJoin
-
getSubJoin
-
toString
-
toSQLText
-
getJoinTypeForJoinExpressionType
public static SQLJoin.JoinType getJoinTypeForJoinExpressionType(org.datanucleus.store.query.expression.JoinExpression.JoinType ejt)
-