Class 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: 2015-04-20 11:08:18 +0200 (må, 20 apr 2015) $
    • 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
      • POSITION

        public static final VirtualColumn POSITION
        This column stores the data cube position coordinate.
      • 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
      • 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 the Reporters 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 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.
      • 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 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.
      • 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.
        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.
      • 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)