Class BioMaterial

    • Method Detail

      • getById

        public static BioMaterial getById​(DbControl dc,
                                          int id)
        Get a biomaterial item when you know the id. This method can return any of the subclasses of BioMaterial. Eg. BioSource, Sample or Extract.
        Parameters:
        dc - The DbControl which will be used for permission checking and database access.
        id - The id of the item to load
        Returns:
        The Sample item
        Throws:
        ItemNotFoundException - If an item with the specified id is not found
        PermissionDeniedException - If the logged in user doesn't have read permission to the item
        BaseException - If there is another error
        Since:
        2.17
      • getExternalId

        public String getExternalId()
        Get the external id of the biomaterial. This value can be used to link with information in external databases. It is not used by the BASE core and it doesn't have to be unique.
        Returns:
        The external id for the biomaterial
      • countChildren

        public abstract long countChildren​(boolean pooled)
        Count the number of already existing children to this biomaterial. The count includes items that the logged in user doesn't have access to.
        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
      • getChildCreationEvents

        public SpecialQuery<BioMaterialEventSource> getChildCreationEvents()
        Get a query returning all events where this biomaterial has been used as a source item.
        Returns:
        A special query
        Since:
        3.0