org.datanucleus.store.rdbms.sql
Class SQLColumn

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

public class SQLColumn
extends java.lang.Object

Representation of a column reference in an SQL statement. Has a column, and an optional alias. TODO Merge this with ColumnExpression


Field Summary
protected  org.datanucleus.store.mapped.DatastoreIdentifier alias
          Alias for the column, for use in a SELECT clause.
protected  org.datanucleus.store.mapped.DatastoreField column
          The column being referenced.
protected  SQLTable table
          The SQL Table that we are selecting columns from.
 
Constructor Summary
SQLColumn(SQLTable table, org.datanucleus.store.mapped.DatastoreField col, org.datanucleus.store.mapped.DatastoreIdentifier alias)
          Constructor for a column reference.
 
Method Summary
 org.datanucleus.store.mapped.DatastoreIdentifier getAlias()
           
 org.datanucleus.store.mapped.DatastoreField getColumn()
           
 SQLTable getTable()
           
 java.lang.String toString()
          Stringifier method to return this "column" in a form for use in SQL statements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

table

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


column

protected org.datanucleus.store.mapped.DatastoreField column
The column being referenced.


alias

protected org.datanucleus.store.mapped.DatastoreIdentifier alias
Alias for the column, for use in a SELECT clause.

Constructor Detail

SQLColumn

public SQLColumn(SQLTable table,
                 org.datanucleus.store.mapped.DatastoreField col,
                 org.datanucleus.store.mapped.DatastoreIdentifier alias)
Constructor for a column reference.

Parameters:
table - The SQLTable being selected
col - The column
alias - An alias
Method Detail

getTable

public SQLTable getTable()

getColumn

public org.datanucleus.store.mapped.DatastoreField getColumn()

getAlias

public org.datanucleus.store.mapped.DatastoreIdentifier getAlias()

toString

public java.lang.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 java.lang.Object
Returns:
The String form for use


Copyright © 2009. All Rights Reserved.