Class FromClause

    • Constructor Detail

      • FromClause

        public FromClause​(Fragment root)
        Create a new instance of a FromClause.
        Parameters:
        root - root SQL statement this FROM clause belongs to
    • Method Detail

      • table

        public FromClause table​(String name)
        Add a table name to the FromClause.
        Parameters:
        name - table name
        Returns:
        FROM clause
      • tableAs

        public FromClause tableAs​(String name,
                                  String as)
        Add a table name with an alias to the FromClause.
        Parameters:
        name - table name
        as - table alias
        Returns:
        parent FROM clause
      • valueTable

        public FromClause valueTable​(ValueTable valueTable)
        Create a FromClause from a value table.
        Parameters:
        valueTable - table of value expressions
        Returns:
        parent FROM clause
      • valueTableAs

        public FromClause valueTableAs​(ValueTable valueTable,
                                       String tableNameAlias,
                                       String... columnNameAliases)
        Create a FromClause from a value table and an alias.
        Parameters:
        valueTable - table of value expressions
        tableNameAlias - table alias
        columnNameAliases - columns aliases
        Returns:
        parent FROM clause
      • join

        public FromClause join​(String name,
                               String specification)
        Create a new Join that belongs to a FROM clause.
        Parameters:
        name - name of the table to be joined
        specification - join conditions
        Returns:
        parent FROM clause
      • innerJoin

        public FromClause innerJoin​(String name,
                                    String specification)
        Create a new inner Join that belongs to a FROM clause.
        Parameters:
        name - name of the table to be joined
        specification - join conditions
        Returns:
        parent FROM clause
      • leftJoin

        public FromClause leftJoin​(String name,
                                   String specification)
        Create a new left Join that belongs to a FROM clause.
        Parameters:
        name - name of the table to be joined
        specification - join conditions
        Returns:
        parent FROM clause
      • rightJoin

        public FromClause rightJoin​(String name,
                                    String specification)
        Create a new right Join that belongs to a FROM clause.
        Parameters:
        name - name of the table to be joined
        specification - join conditions
        Returns:
        parent FROM clause
      • fullJoin

        public FromClause fullJoin​(String name,
                                   String specification)
        Create a new full Join that belongs to a FROM clause.
        Parameters:
        name - name of the table to be joined
        specification - join conditions
        Returns:
        parent FROM clause
      • leftOuterJoin

        public FromClause leftOuterJoin​(String name,
                                        String specification)
        Create a new left outer Join that belongs to a FROM clause.
        Parameters:
        name - name of the table to be joined
        specification - join conditions
        Returns:
        parent FROM clause
      • rightOuterJoin

        public FromClause rightOuterJoin​(String name,
                                         String specification)
        Create a new right outer Join that belongs to a FROM clause.
        Parameters:
        name - name of the table to be joined
        specification - join conditions
        Returns:
        parent FROM clause
      • fullOuterJoin

        public FromClause fullOuterJoin​(String name,
                                        String specification)
        Create a new full outer Join that belongs to a FROM clause.
        Parameters:
        name - name of the table to be joined
        specification - join conditions
        Returns:
        parent FROM clause
      • select

        public FromClause select​(Select select)
        Add a select to the FromClause.
        Parameters:
        select - SELECT statement
        Returns:
        FROM clause
      • hasSubSelect

        public boolean hasSubSelect()
        Check if the FromClause contains a sub-select statement.
        Returns:
        true if the FromClause contains a sub-select statement
      • accept

        public void accept​(SelectVisitor visitor)
        Description copied from interface: SelectFragment
        Accept a visitor (e.g. a renderer or validator)
        Specified by:
        accept in interface SelectFragment
        Parameters:
        visitor - visitor to accept