Class BioSource

    • Method Detail

      • getNew

        public static BioSource getNew​(DbControl dc)
                                throws BaseException
        Create a new BioSource item.
        Parameters:
        dc - The DbControl which will be used for permission checking and database access
        Returns:
        The new BioSource item
        Throws:
        BaseException - If there is an error
      • getType

        public Item getType()
        Description copied from interface: Identifiable
        Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.
        Specified by:
        getType in interface Identifiable
        Returns:
        A value indicating the type of item
      • getEntryDate

        public Date getEntryDate()
        Description copied from interface: Registered
        Get the date that the item was registered in the database.
        Specified by:
        getEntryDate in interface Registered
        Returns:
        A date or null if this is not known
      • setEntryDate

        public void setEntryDate​(Date entryDate)
        Description copied from interface: Registered
        Set the date the entry was registered in the database. Implementations should only allow this property to be set before the item is first stored in the database. The intention of this method is to facilitate export/import of data between server.
        Specified by:
        setEntryDate in interface Registered
        Parameters:
        entryDate - A date or null to use today's date
      • getSamples

        public ItemQuery<Sample> getSamples()
        Get a query that returns all samples created from this biosource.
        Returns:
        An ItemQuery object
      • countSamples

        public long countSamples()
                          throws BaseException
        Counts all samples that have been created from this biosource. The count includes samples that the logged in user doesn't have access to.
        Returns:
        The number of samples
        Throws:
        BaseException - If counting the samples fails.
      • countChildren

        public long countChildren​(boolean pooled)
        Count the number of child samples. Since biosources can't be pooled this method always return 0 if pooled=TRUE
        Specified by:
        countChildren in class BioMaterial
        Parameters:
        pooled - If TRUE, the count is for biomaterials of the same type, if FALSE the count is for biomaterials of the child type
        Since:
        2.16