Class 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).
    • 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 to
        sourceTbl - Table we are joining from
        condition - Join condition
    • Method Detail

      • 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()
      • getJoinTypeForJoinExpressionType

        public static SQLJoin.JoinType getJoinTypeForJoinExpressionType​(org.datanucleus.query.expression.JoinExpression.JoinType ejt)