Class SQLColumn

java.lang.Object
org.datanucleus.store.rdbms.sql.SQLColumn

public class SQLColumn extends Object
Representation of a column reference in an SQL statement. Has a column, and an optional alias. TODO Merge this with ColumnExpression
  • Field Details

    • table

      protected SQLTable table
      The SQL Table that we are selecting columns from.
    • column

      protected Column column
      The column being referenced.
    • alias

      protected DatastoreIdentifier alias
      Alias for the column, for use in a SELECT clause.
  • Constructor Details

    • SQLColumn

      public SQLColumn(SQLTable table, Column col, DatastoreIdentifier alias)
      Constructor for a column reference.
      Parameters:
      table - The SQLTable being selected
      col - The column
      alias - An alias
  • Method Details

    • getTable

      public SQLTable getTable()
    • getColumn

      public Column getColumn()
    • getAlias

      public DatastoreIdentifier getAlias()
    • getColumnSelectString

      public String getColumnSelectString()
    • toString

      public String toString()
      Stringifier method to return this "column" in a form for use in SQL statements. This can be of the following form(s)
       TABLEALIAS.MYCOLUMN AS COLUMNALIAS
       MYTABLE.MYCOLUMN AS COLUMNALIAS
       TABLEALIAS.MYCOLUMN
       MYTABLE.MYCOLUMN
       
      Also applies any "select-function" defined on the Column.
      Overrides:
      toString in class Object
      Returns:
      The String form for use