Class Reporter


  • public class Reporter
    extends Object
    This is an utilitiy class for reporters.
    Version:
    2.0
    Author:
    Samuel, Nicklas
    Last modified
    $Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
    • Field Detail

      • metaData

        private static org.hibernate.metadata.ClassMetadata metaData
    • Constructor Detail

      • Reporter

        public Reporter()
    • Method Detail

      • getById

        public static ReporterData getById​(DbControl dc,
                                           int id,
                                           Experiment experiment)
        Get a ReporterData object when you know the ID, possibly using the cloned reporter annotations of the given experiment. If the experiment doesn't have cloned reporter information this method is the same as getById(DbControl, int). If the experiment has cloned information, all non-cloned properties are set to null.
        Parameters:
        dc - The DbControl which will be used for permission checking and database access
        id - The ID of the reporter
        experiment - The experiment which may have cloned reporter information
        Returns:
        The ReporterData object
        Since:
        3.1
      • getByExternalId

        public static ReporterData getByExternalId​(DbControl dc,
                                                   String externalId,
                                                   Experiment experiment)
        Get a ReporterData object when you know the external id, possibly using the cloned reporter annotations of the given experiment. If the experiment doesn't have cloned reporter information this method is the same as getByExternalId(DbControl, String). If the experiment has cloned information, all non-cloned properties are set to null.

        Use this method only when you need to get a few reporters. If you need to get many reporters use a query from the getDynamicQuery(Experiment) method instead. It has better performance since it resuses a single query instead of creating a new one each time as this method does.

        Parameters:
        dc - The DbControl which will be used for permission checking and database access
        externalId - The external id of the reporter
        experiment - The experiment which may have cloned reporter information
        Returns:
        The ReporterData object
        Since:
        3.1
      • getProxy

        public static ReporterData getProxy​(int reporterId)
        Get a proxy reporter object. This method is usefult when linking reporters to other items, and you are sure that a reporter with the given ID exists. Since this method doesn't hit the database, there are some things to be aware of:
        • There is no check to see if a reporter with the given ID exists or not
        • The returned object doesn't contain any reporter information except the ID.
        Parameters:
        reporterId - The ID of the reporter
        Returns:
        A reporter object
        Since:
        2.8
      • getClonedSelectSql

        private static String getClonedSelectSql​(VirtualDb vdb)
        Generate an SQL statement for selecting ALL reporter properties from a cloned table. Properties that have not been cloned should be included as 'null' selects.