Package org.datanucleus.store.rdbms.sql
Class SQLJoin
- java.lang.Object
-
- org.datanucleus.store.rdbms.sql.SQLJoin
-
public class SQLJoin extends Object
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 Modifier and Type Class Description static class
SQLJoin.JoinType
-
Constructor Summary
Constructors Constructor Description SQLJoin(SQLJoin.JoinType type, SQLTable targetTbl, SQLTable sourceTbl, BooleanExpression condition)
Constructor for a join.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAndCondition(BooleanExpression expr)
Method to update the join "condition" to AND the provided expression.BooleanExpression
getCondition()
Accessor for the conditions of the join.static SQLJoin.JoinType
getJoinTypeForJoinExpressionType(org.datanucleus.store.query.expression.JoinExpression.JoinType ejt)
SQLTable
getSourceTable()
Accessor for the table we are joining from.SQLJoin
getSubJoin()
SQLTable
getTargetTable()
Accessor for the table we are joining to.SQLJoin.JoinType
getType()
void
setSubJoin(SQLJoin join)
void
setType(SQLJoin.JoinType type)
SQLText
toSQLText(DatastoreAdapter dba, boolean lock)
String
toString()
-
-
-
Constructor Detail
-
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 Detail
-
getType
public SQLJoin.JoinType getType()
-
setType
public void setType(SQLJoin.JoinType type)
-
getTargetTable
public SQLTable getTargetTable()
Accessor for the table we are joining to.- Returns:
- The table joined to
-
getSourceTable
public SQLTable getSourceTable()
Accessor for the table we are joining from.- Returns:
- The table we join from to bring in this other table
-
getCondition
public BooleanExpression getCondition()
Accessor for the conditions of the join. These conditions can include- Returns:
- The conditions
-
addAndCondition
public void addAndCondition(BooleanExpression expr)
Method to update the join "condition" to AND the provided expression.- Parameters:
expr
- The expression to add to the join "condition"
-
setSubJoin
public void setSubJoin(SQLJoin join)
-
getSubJoin
public SQLJoin getSubJoin()
-
toSQLText
public SQLText toSQLText(DatastoreAdapter dba, boolean lock)
-
getJoinTypeForJoinExpressionType
public static SQLJoin.JoinType getJoinTypeForJoinExpressionType(org.datanucleus.store.query.expression.JoinExpression.JoinType ejt)
-
-