Class SubSelect<T>

java.lang.Object
org.tentackle.dbms.dsl.SubSelect<T>
Type Parameters:
T - the java type of the single column returned by the sub-select
All Implemented Interfaces:
Expression<T>, SqlElement

public class SubSelect<T> extends Object implements Expression<T>
A sub-select used as a scalar expression.
Author:
harald
  • Constructor Details

    • SubSelect

      public SubSelect(Select select, DataType<T> dataType)
      Creates a scalar sub-select.
      Parameters:
      select - the sub-select returning a single row and column
      dataType - the datatype, null if untyped
  • Method Details

    • getSelect

      public Select getSelect()
      Gets the sub-select.
      Returns:
      the sub-select
    • getDataType

      public DataType<T> getDataType()
      Description copied from interface: Expression
      Gets the datatype of this expression.
      Specified by:
      getDataType in interface Expression<T>
      Returns:
      the datatype, null if untyped
    • getColumnCount

      public int getColumnCount(Backend backend)
      Description copied from interface: Expression
      Gets the number of database columns this expression spans.
      Specified by:
      getColumnCount in interface Expression<T>
      Parameters:
      backend - the backend
      Returns:
      the number of columns, always >= 1
    • render

      public void render(RenderContext context, int columnIndex)
      Description copied from interface: Expression
      Renders a single column of this expression.
      Specified by:
      render in interface Expression<T>
      Parameters:
      context - the render context
      columnIndex - the column index, 0 for the first column