java.lang.Object
com.northconcepts.datapipeline.jdbc.sql.SqlPart
com.northconcepts.datapipeline.jdbc.sql.select.QuerySource
Direct Known Subclasses:
Select, TableQuerySource, Union

public abstract class QuerySource extends SqlPart
Base class for what a Select reads from: a table, a nested query or a Union.
  • Constructor Details

    • QuerySource

      public QuerySource()
  • Method Details

    • setPretty

      public QuerySource setPretty(boolean pretty)
      Description copied from class: SqlPart
      Indicates if SqlPart.getSqlFragment() adds line breaks and indentation instead of using one line (default is false).
      Overrides:
      setPretty in class SqlPart
    • getTables

      public abstract List<String> getTables()
      Returns the tables this source reads from, including those of nested sources but not joined tables.
    • getTable

      public abstract String getTable()

      Returns the first table in the list of tables.


      If this query source involves more than one table, use getTables() instead of this method.
    • containsTable

      public abstract boolean containsTable(String table)
      Returns true if this source, a nested source or a join refers to the table (ignoring case).
    • shouldWrapWhenNested

      public boolean shouldWrapWhenNested()
      Indicates if this source is parenthesized when used in a FROM clause (true except for a plain table).
    • getNestedAlias

      public String getNestedAlias()
      Returns the alias written after this source in a FROM clause or null for none.
    • setNestedAlias

      public QuerySource setNestedAlias(String nestedAlias)
      Sets the alias written after this source in a FROM clause (null for none).