2.17.2: 2011-06-17

net.sf.basedb.core
Class VirtualColumn

java.lang.Object
  extended by net.sf.basedb.core.VirtualColumn

public class VirtualColumn
extends Object

This class is used to define columns in the virtual tables in the dynamic part of the database that are storing analysed data. The information in these objects are used by HibernateUtil.createVirtualTable(VirtualDb, VirtualTable) to create the extra tables needed by an experiment to store analysed data. These objects are also used in query elements by DynamicQuery:s when it needs to reference a certain column in one of the dynamic tables.

Version:
2.0
Author:
Nicklas
See Also:
VirtualTable, Dynamic
Last modified
$Date: 2010-11-03 15:02:49 +0100 (Wed, 03 Nov 2010) $

Field Summary
private  String column
          The column name in the database of the column.
static VirtualColumn COLUMN
          This column stores the data cube column coordinate.
static VirtualColumn CUBE
          This column stores the data cube number.
static VirtualColumn EXTRA
          This column stores the data cube extra value number.
static VirtualColumn EXTRA_FLOAT
          This column stores extra float values.
static VirtualColumn EXTRA_INT
          This column stores extra integer values.
static VirtualColumn EXTRA_STRING
          This column stores extra string values.
private static Map<Type,VirtualColumn> extraValueColumns
          A cache of virtual column objects for extra value types.
static VirtualColumn FILTER
          This column stores the data cube filter number.
private  boolean indexed
          If the column should be indexed or not.
static boolean INDEXED
          Used in constructor to tell that the column should be indexed.
static VirtualColumn LAYER
          This column stores the data cube layer coordinate.
private  String name
          The name of the column.
private  boolean nullable
          If the column should be nullable or not.
static boolean NULLABLE
          Used in constructor to tell that the column should be nullable.
static VirtualColumn POSITION
          This column stores the data cube position coordinate.
static boolean PRIMARY_KEY
          Used in constructor to tell that the column is part of the primary key.
private  boolean primaryKey
          If the column should be part of the primary key or not.
static VirtualColumn RAWBIOASSAY_ID
          This column stores the id of a raw bioassay.
static VirtualColumn RAWDATA_ID
          This column stores the id of a raw date object.
static VirtualColumn REPORTER_ID
          This column stores the id of a reporter.
private  int size
          The size of the column if it is a string.
private  TypeWrapper typeWrapper
          The data type of the column.
private  boolean untransformIntensities
           
 
Constructor Summary
private VirtualColumn(String name, String column, TypeWrapper type, int size, boolean indexed, boolean nullable, boolean primaryKey, boolean untransformIntensities)
          Create a new virtual column.
 
Method Summary
static VirtualColumn channel(int channel)
          Deprecated. In 2.12. Use channelIntensity(int) or channelRaw(int) instead. This method is forwarded to channelIntensity(int) for maximum backwards compatibility.
static VirtualColumn channelIntensity(int channel)
          Get a column that returns the intensity values for a channel.
static VirtualColumn channelRaw(int channel)
          Get a column that stores the raw spot value for a channel.
 boolean equals(Object other)
          A virtual column is equal to another if both have the same name.
static VirtualColumn extraValue(Type valueType)
          Get a column that stores the calculated extra values for a value type.
 String getColumn()
          Get the database column name of the column.
 String getName()
          Get the name of the column.
 int getSize()
          Get the maximum size of data in the column if it is a string.
 TypeWrapper getTypeWrapper()
          Get a wrapper for accessing underlying type information from Hibernate.
 int hashCode()
           
 boolean isIndexed()
          If the column is indexed or not.
 boolean isNullable()
          If null values are allowed in the column or not.
 boolean isPrimaryKey()
          If the column is part of the primary key or not.
 boolean untransformIntensities()
          A flag indicating if transformed intensity valus belonging to a bioassay set should be untransformed as part of a query.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEXED

public static final boolean INDEXED
Used in constructor to tell that the column should be indexed.

See Also:
Constant Field Values

NULLABLE

public static final boolean NULLABLE
Used in constructor to tell that the column should be nullable.

See Also:
Constant Field Values

PRIMARY_KEY

public static final boolean PRIMARY_KEY
Used in constructor to tell that the column is part of the primary key.

See Also:
Constant Field Values

CUBE

public static final VirtualColumn CUBE
This column stores the data cube number.

See Also:
DataCube.getCubeNo()

LAYER

public static final VirtualColumn LAYER
This column stores the data cube layer coordinate.

See Also:
DataCubeLayer.getLayerNo()

COLUMN

public static final VirtualColumn COLUMN
This column stores the data cube column coordinate.

See Also:
DataCubeColumn.getColumnNo()

POSITION

public static final VirtualColumn POSITION
This column stores the data cube position coordinate.


FILTER

public static final VirtualColumn FILTER
This column stores the data cube filter number.

See Also:
DataCubeFilter.getFilterNo()

EXTRA

public static final VirtualColumn EXTRA
This column stores the data cube extra value number.

See Also:
DataCubeExtraValue.getExtraNo()

REPORTER_ID

public static final VirtualColumn REPORTER_ID
This column stores the id of a reporter. For perfomance reasons it is not linked with a foreign key to the Reporters table.

See Also:
ReporterData

RAWDATA_ID

public static final VirtualColumn RAWDATA_ID
This column stores the id of a raw date object. For perfomance reasons it is not linked with a foreign key to the raw date table.

See Also:
RawData

RAWBIOASSAY_ID

public static final VirtualColumn RAWBIOASSAY_ID
This column stores the id of a raw bioassay. For perfomance reasons it is not linked with a foreign key to the RawBioAssays table.

See Also:
RawBioAssay

EXTRA_INT

public static final VirtualColumn EXTRA_INT
This column stores extra integer values.


EXTRA_FLOAT

public static final VirtualColumn EXTRA_FLOAT
This column stores extra float values.


EXTRA_STRING

public static final VirtualColumn EXTRA_STRING
This column stores extra string values.


extraValueColumns

private static final Map<Type,VirtualColumn> extraValueColumns
A cache of virtual column objects for extra value types.


name

private final String name
The name of the column.


column

private final String column
The column name in the database of the column.


typeWrapper

private final TypeWrapper typeWrapper
The data type of the column.


size

private final int size
The size of the column if it is a string.


indexed

private final boolean indexed
If the column should be indexed or not.


nullable

private final boolean nullable
If the column should be nullable or not.


primaryKey

private final boolean primaryKey
If the column should be part of the primary key or not.


untransformIntensities

private final boolean untransformIntensities
Constructor Detail

VirtualColumn

private VirtualColumn(String name,
                      String column,
                      TypeWrapper type,
                      int size,
                      boolean indexed,
                      boolean nullable,
                      boolean primaryKey,
                      boolean untransformIntensities)
Create a new virtual column.

Method Detail

channel

public static VirtualColumn channel(int channel)
Deprecated. In 2.12. Use channelIntensity(int) or channelRaw(int) instead. This method is forwarded to channelIntensity(int) for maximum backwards compatibility.

Parameters:
channel - The channel for which the intensity is calculated.
Returns:
a VirtualColumn object

channelRaw

public static VirtualColumn channelRaw(int channel)
Get a column that stores the raw spot value for a channel. This may be an intensity value or a transformed value as given by the BioAssaySet.getIntensityTransform() for the current bioassay set.

Parameters:
channel - The channel number
Returns:
a VirtualColumn object.
Since:
2.12
See Also:
channelIntensity(int)

channelIntensity

public static VirtualColumn channelIntensity(int channel)
Get a column that returns the intensity values for a channel. Transformed intensity values (as given by the BioAssaySet.getIntensityTransform() setting for the current bioassay set), are untransformed automatically.

Parameters:
channel - The channel number
Returns:
a VirtualColumn object
Since:
2.12
See Also:
channelRaw(int)

extraValue

public static VirtualColumn extraValue(Type valueType)
Get a column that stores the calculated extra values for a value type. Only one VirtualColumn object per type exists. Only Type.INT, Type.FLOAT and Type.STRING are supported.

Parameters:
valueType - The type to get the column for.
Returns:
a VirtualColumn object.

equals

public boolean equals(Object other)
A virtual column is equal to another if both have the same name.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getName

public String getName()
Get the name of the column. This is the name that is used as an alias in SQL SELECT statements by default.

Returns:
a String

getColumn

public String getColumn()
Get the database column name of the column.

Returns:
a String

getTypeWrapper

public TypeWrapper getTypeWrapper()
Get a wrapper for accessing underlying type information from Hibernate.

Since:
2.16

getSize

public int getSize()
Get the maximum size of data in the column if it is a string. Ie. getType() == Hibernate.STRING

Returns:
The size as an int.

isIndexed

public boolean isIndexed()
If the column is indexed or not.

Returns:
TRUE if indexed, FALSE otherwise.

isNullable

public boolean isNullable()
If null values are allowed in the column or not.

Returns:
TRUE if null is allowed, FALSE otherwise

isPrimaryKey

public boolean isPrimaryKey()
If the column is part of the primary key or not.

Returns:
TRUE if it's part of, FALSE otherwise.

untransformIntensities

public boolean untransformIntensities()
A flag indicating if transformed intensity valus belonging to a bioassay set should be untransformed as part of a query.

Since:
2.12
See Also:
channelIntensity(int)

2.17.2: 2011-06-17