Package net.sf.basedb.core
Class VirtualColumn
- java.lang.Object
-
- 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 byHibernateUtil.createVirtualTable(VirtualDb, VirtualTable)
to create the extra tables needed by an experiment to store analysed data. These objects are also used in query elements byDynamicQuery
: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: 2015-04-20 11:08:18 +0200 (må, 20 apr 2015) $
-
-
Field Summary
Fields Modifier and Type Field Description 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_EXTERNAL_ID
Column for storing the external reporter id.static VirtualColumn
REPORTER_ID
This column stores the id of a reporter.static VirtualColumn
REPORTER_ID_PK
Column for storing the id of a reporter when it is part of the primary key.static VirtualColumn
REPORTER_VERSION
Column for storing the original version of a reporter that is cloned to a virtual table.private int
size
The size of the column if it is a string.private TypeWrapper<?>
typeWrapper
The data type of the column.private boolean
unique
If the column must contain unique values or not.static boolean
UNIQUE
Used in constructor to tell that the column must contain only unique values.private boolean
untransformIntensities
-
Constructor Summary
Constructors Modifier Constructor Description private
VirtualColumn(String name, String column, TypeWrapper<?> type, int size, boolean indexed, boolean unique, boolean nullable, boolean primaryKey, boolean untransformIntensities)
Create a new virtual column.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.static VirtualColumn
clonableProperty(ClonableProperty property)
Get a virtual column view of a cloned reporter property.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
isUnique()
If the column must contain unique values or not.boolean
untransformIntensities()
A flag indicating if transformed intensity valus belonging to a bioassay set should be untransformed as part of a query.
-
-
-
Field Detail
-
INDEXED
public static final boolean INDEXED
Used in constructor to tell that the column should be indexed.- See Also:
- Constant Field Values
-
UNIQUE
public static final boolean UNIQUE
Used in constructor to tell that the column must contain only unique values.- Since:
- 3.1
- 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 theReporters
table.- See Also:
ReporterData
-
REPORTER_ID_PK
public static final VirtualColumn REPORTER_ID_PK
Column for storing the id of a reporter when it is part of the primary key. For perfomance reasons it is not linked with a foreign key to theReporters
table.- Since:
- 3.1
-
REPORTER_VERSION
public static final VirtualColumn REPORTER_VERSION
Column for storing the original version of a reporter that is cloned to a virtual table.- Since:
- 3.1
-
REPORTER_EXTERNAL_ID
public static final VirtualColumn REPORTER_EXTERNAL_ID
Column for storing the external reporter id.- Since:
- 3.1
-
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 theRawBioAssays
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.
-
unique
private final boolean unique
If the column must contain unique values 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 unique, boolean nullable, boolean primaryKey, boolean untransformIntensities)
Create a new virtual column.
-
-
Method Detail
-
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 theBioAssaySet.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 theBioAssaySet.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 oneVirtualColumn
object per type exists. OnlyType.INT
,Type.FLOAT
andType.STRING
are supported.- Parameters:
valueType
- The type to get the column for.- Returns:
- a VirtualColumn object.
-
clonableProperty
public static VirtualColumn clonableProperty(ClonableProperty property)
Get a virtual column view of a cloned reporter property.- Parameters:
property
- The cloned reporter property- Returns:
- A virtual column representation of the cloned property
- Since:
- 3.1
-
equals
public boolean equals(Object other)
A virtual column is equal to another if both have the same name.
-
getName
public String getName()
Get the name of the column. This is the name that is used as an alias in SQLSELECT
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.
-
isUnique
public boolean isUnique()
If the column must contain unique values or not.- Returns:
- TRUE if unique, 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)
-
-