org.israfil.sqlelements
Class SimpleColumn

java.lang.Object
  extended by org.israfil.sqlelements.AbstractAliasedSQLElement
      extended by org.israfil.sqlelements.SimpleColumn
All Implemented Interfaces:
java.lang.Cloneable, AliasedSQLElement, Column, SQLElement

public class SimpleColumn
extends AbstractAliasedSQLElement
implements Column

A simple implementation of a Column which takes a name and a table. The table can be any Table object.

Version:
$Revision: 25 $
Author:
Christian Edward Gruber , Latest: $Author: cgruber $

Field Summary
protected  java.lang.String name
           
protected  Table table
           
 
Fields inherited from class org.israfil.sqlelements.AbstractAliasedSQLElement
alias
 
Constructor Summary
SimpleColumn(Table table, java.lang.String colName)
          Constructs a Column implementation instance
SimpleColumn(Table table, java.lang.String colName, java.lang.String alias)
          Constructs a Column implementation instance
 
Method Summary
static SimpleColumn[] createColumns(Table table, java.lang.String... names)
          Convenience method to create batches of SimpleColumns from an array of names.
 java.lang.String getName()
           
 Table getTable()
           
 java.lang.String render(SQLRenderContext context)
           
 java.lang.String toString()
           
 
Methods inherited from class org.israfil.sqlelements.AbstractAliasedSQLElement
finalize, getAlias, hasAlias, setAlias
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.israfil.sqlelements.AliasedSQLElement
getAlias, hasAlias
 

Field Detail

table

protected Table table

name

protected java.lang.String name
Constructor Detail

SimpleColumn

public SimpleColumn(Table table,
                    java.lang.String colName)
Constructs a Column implementation instance

Parameters:
table - A Table object of which this Column is a field.
colName - The name of this column

SimpleColumn

public SimpleColumn(Table table,
                    java.lang.String colName,
                    java.lang.String alias)
Constructs a Column implementation instance

Parameters:
table - A Table object of which this Column is a field.
colName - The name of this column
alias - An alternate designation for this column - usually shorter
Method Detail

getTable

public Table getTable()
Specified by:
getTable in interface Column

getName

public java.lang.String getName()
Specified by:
getName in interface Column

render

public java.lang.String render(SQLRenderContext context)
Specified by:
render in interface SQLElement

createColumns

public static SimpleColumn[] createColumns(Table table,
                                           java.lang.String... names)
Convenience method to create batches of SimpleColumns from an array of names. Note: this cannot be used to create SimpleColumns with aliases.

Parameters:
table - A table, within whom the columns will be created.
names - An array of column names
Returns:
an array of SimpleColumns

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 2005-2005-2006 null. All Rights Reserved.