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.
Column.Name, Column.Type
Constructor and Description |
---|
VirtualColumn(Column.Name pName,
Column.Type pType) |
VirtualColumn(java.lang.String pName,
Column.Type pType) |
Modifier and Type | Method and Description |
---|---|
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) |
equals, getCustomData, getLength, getName, getType, hasFixedLength, hashCode, isBinaryColumn, isNullable, isStringColumn, setCustomData, setLength, setLength, setNullable
public VirtualColumn(Column.Name pName, Column.Type pType)
public VirtualColumn(java.lang.String pName, Column.Type pType)
public Table getTable()
Column
Returns the columns table.
public java.lang.String getQName()
Column
Returns the columns fully qualified name, which is
getTable().getQName() + "." + getName()
.
public boolean isPrimaryKeyPart()
Column
Returns whether this column is part of the primary key.
isPrimaryKeyPart
in interface Column
public TableReference getTableReference()
ColumnReference
Returns the TableReference
that created the
column reference.
getTableReference
in interface ColumnReference
public Column getColumn()
ColumnReference
Returns the referenced Column
.
getColumn
in interface ColumnReference
public boolean isVirtual()
Column
Returns whether this column is a true column or a virtual column.
public void setAlias(java.lang.String pName)
ColumnReference
Sets the references alias name, if any. Null indicates, that an alias name may be choosen.
setAlias
in interface ColumnReference
public void setAlias(Column.Name pName)
ColumnReference
Sets the references alias name, if any. Null indicates, that an alias name may be choosen.
setAlias
in interface ColumnReference
public Column.Name getAlias()
ColumnReference
Returns the references alias name, if any. Null indicates, that an alias name may be choosen.
getAlias
in interface ColumnReference
public void setValue(java.lang.String pValue)
public void setValue(SelectStatement pValue)
public void setValue(Function pValue)
public java.lang.Object getValue()