org.apache.ws.jaxme.sqls.impl
Class VirtualColumn

java.lang.Object
  extended by org.apache.ws.jaxme.sqls.impl.AbstractColumn
      extended by org.apache.ws.jaxme.sqls.impl.VirtualColumn
All Implemented Interfaces:
BinaryColumn, Column, ColumnReference, StringColumn

public class VirtualColumn
extends AbstractColumn
implements ColumnReference

A virtual column is a named item that can be added to the result set. For example:

   SELECT name, vorname, MAX(a) AS max FROM ...
 

The example uses a virtual column max. The value of max is calculated from other values.

Author:
Jochen Wiedmann

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.ws.jaxme.sqls.Column
Column.Name, Column.Type
 
Nested classes/interfaces inherited from interface org.apache.ws.jaxme.sqls.Column
Column.Name, Column.Type
 
Nested classes/interfaces inherited from interface org.apache.ws.jaxme.sqls.Column
Column.Name, Column.Type
 
Constructor Summary
VirtualColumn(Column.Name pName, Column.Type pType)
           
VirtualColumn(java.lang.String pName, Column.Type pType)
           
 
Method Summary
 Column.Name getAlias()
          Returns the references alias name, if any.
 Column getColumn()
          Returns the referenced Column.
 java.lang.String getQName()
          Returns the columns fully qualified name, which is getTable().getQName() + "." + getName().
 Table getTable()
          Returns the columns table.
 TableReference getTableReference()
          Returns the TableReference that created the column reference.
 java.lang.Object getValue()
           
 boolean isPrimaryKeyPart()
          Returns whether this column is part of the primary key.
 boolean isVirtual()
          Returns whether this column is a true column or a virtual column.
 void setAlias(Column.Name pName)
          Sets the references alias name, if any.
 void setAlias(java.lang.String pName)
          Sets the references alias name, if any.
 void setValue(Function pValue)
           
 void setValue(SelectStatement pValue)
           
 void setValue(java.lang.String pValue)
           
 
Methods inherited from class org.apache.ws.jaxme.sqls.impl.AbstractColumn
equals, getCustomData, getLength, getName, getType, hasFixedLength, hashCode, isBinaryColumn, isNullable, isStringColumn, setCustomData, setLength, setLength, setNullable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualColumn

public VirtualColumn(Column.Name pName,
                     Column.Type pType)

VirtualColumn

public VirtualColumn(java.lang.String pName,
                     Column.Type pType)
Method Detail

getTable

public Table getTable()
Description copied from interface: Column

Returns the columns table.

Specified by:
getTable in interface Column

getQName

public java.lang.String getQName()
Description copied from interface: Column

Returns the columns fully qualified name, which is getTable().getQName() + "." + getName().

Specified by:
getQName in interface Column

isPrimaryKeyPart

public boolean isPrimaryKeyPart()
Description copied from interface: Column

Returns whether this column is part of the primary key.

Specified by:
isPrimaryKeyPart in interface Column

getTableReference

public TableReference getTableReference()
Description copied from interface: ColumnReference

Returns the TableReference that created the column reference.

Specified by:
getTableReference in interface ColumnReference

getColumn

public Column getColumn()
Description copied from interface: ColumnReference

Returns the referenced Column.

Specified by:
getColumn in interface ColumnReference

isVirtual

public boolean isVirtual()
Description copied from interface: Column

Returns whether this column is a true column or a virtual column.

Specified by:
isVirtual in interface Column

setAlias

public void setAlias(java.lang.String pName)
Description copied from interface: ColumnReference

Sets the references alias name, if any. Null indicates, that an alias name may be choosen.

Specified by:
setAlias in interface ColumnReference

setAlias

public void setAlias(Column.Name pName)
Description copied from interface: ColumnReference

Sets the references alias name, if any. Null indicates, that an alias name may be choosen.

Specified by:
setAlias in interface ColumnReference

getAlias

public Column.Name getAlias()
Description copied from interface: ColumnReference

Returns the references alias name, if any. Null indicates, that an alias name may be choosen.

Specified by:
getAlias in interface ColumnReference

setValue

public void setValue(java.lang.String pValue)

setValue

public void setValue(SelectStatement pValue)

setValue

public void setValue(Function pValue)

getValue

public java.lang.Object getValue()