Class BioPlateType

java.lang.Object
net.sf.basedb.core.BasicItem
net.sf.basedb.core.BioPlateType
All Implemented Interfaces:
AccessControlled, Identifiable, Nameable, Removable

public class BioPlateType
extends BasicItem
implements Nameable, Removable
This class represents the type of a bio-plate. This information can be used together with event definitions to create a work path in the lab. Eg. start with a plate of some type T1, then apply event E1 to it to get a new plate with type T2, repeat with event E2 to get a plate with type T3, and so on until the biomaterial has been hybridized.
Since:
2.16
Author:
Nicklas
Last modified
$Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
  • Field Details

  • Constructor Details

  • Method Details

    • getNew

      public static BioPlateType getNew​(DbControl dc) throws BaseException, InvalidDataException
      Creates a new bioplate type.
      Parameters:
      dc - DbControl used for database access
      Returns:
      A new BioPlate object
      Throws:
      BaseException - If anything goes wrong when creating
      InvalidDataException
    • getById

      public static BioPlateType getById​(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
      Gets a BioPlate type when knowing the item's id
      Parameters:
      dc - DbControl used for database access
      id - The item's id.
      Returns:
      BioPlateType object
      Throws:
      ItemNotFoundException - If no item with the given id was found
      PermissionDeniedException - If logged in user doesn't have read permission to the requested item
      BaseException - If there is another error.
    • getQuery

      public static ItemQuery<BioPlateType> getQuery()
      Gets query that selects all available bioplates
      Returns:
      ItemQuery object
    • getData

      BioPlateTypeData getData()
      Description copied from class: BasicItem
      Get the BasicData object that holds all data for this item.
      Specified by:
      getData in class BasicItem
    • 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
    • getName

      public String getName()
      Description copied from interface: Nameable
      Get the name of the item.
      Specified by:
      getName in interface Nameable
      Returns:
      A String with the name of the item
    • setName

      public void setName​(String name) throws PermissionDeniedException, InvalidDataException
      Description copied from interface: Nameable
      Set the name of the item. The name cannot be null and mustn't be longer than the value specified by the Nameable.MAX_NAME_LENGTH constant.
      Specified by:
      setName in interface Nameable
      Parameters:
      name - The new name for the item
      Throws:
      PermissionDeniedException - If the logged in user doesn't have write permission
      InvalidDataException - If the name is null or longer than specified by the Nameable.MAX_NAME_LENGTH constant
    • getDescription

      public String getDescription()
      Description copied from interface: Nameable
      Get the description for the item.
      Specified by:
      getDescription in interface Nameable
      Returns:
      A String with a description of the item
    • setDescription

      public void setDescription​(String description) throws PermissionDeniedException, InvalidDataException
      Description copied from interface: Nameable
      Set the description for the item. The description can be null but mustn't be longer than the value specified by the Nameable.MAX_DESCRIPTION_LENGTH constant.
      Specified by:
      setDescription in interface Nameable
      Parameters:
      description - The new description for the item
      Throws:
      PermissionDeniedException - If the logged in user doesn't have write permission
      InvalidDataException - If the description longer than specified by the Nameable.MAX_DESCRIPTION_LENGTH constant
    • isRemoved

      public boolean isRemoved()
      Description copied from interface: Removable
      Check if the removed flag is set for this item.
      Specified by:
      isRemoved in interface Removable
      Returns:
      TRUE if the item is flagged as removed, FALSE otherwise
    • setRemoved

      public void setRemoved​(boolean removed) throws PermissionDeniedException
      Description copied from interface: Removable
      Set the removed flag for this item.
      Specified by:
      setRemoved in interface Removable
      Parameters:
      removed - TRUE if the item should be flagged as removed, FALSE otherwise
      Throws:
      PermissionDeniedException - If the logged in user doesn't have Permission.DELETE permission for setting the flag to TRUE or Permission.WRITE permission for setting the flag to FALSE
    • getRemovedBy

      public User getRemovedBy() throws PermissionDeniedException, ItemNotFoundException
      Description copied from interface: Removable
      Get the user that flagged this item for removal.
      Specified by:
      getRemovedBy in interface Removable
      Returns:
      A User object, or null if this item has not been flagged
      Throws:
      PermissionDeniedException - If the logged in user doesn't have Permission.READ permission for the user
      ItemNotFoundException - If the user that removed this item can't be found
    • isUsed

      public boolean isUsed()
      Check if there are any BioPlates or BioPlateEventDefinitions using this type.
      Overrides:
      isUsed in class BasicItem
      Returns:
      TRUE if this item is used, FALSE otherwise
      See Also:
      BasicItem.getUsingItems()
    • getUsingItems

      public Set<ItemProxy> getUsingItems()
      Gets all BioPlates and BioPlateEventDefinitions using this type
      Overrides:
      getUsingItems in class BasicItem
      Returns:
      A set containing proxies for the items, or an empty set if no items are using this item
      See Also:
      BasicItem.addUsingItems(Set, Item, org.hibernate.query.Query)
    • getBioMaterialType

      public Item getBioMaterialType()
      Get the biomaterial type that can be stored on plates of this type.
      Returns:
      One of Item.SAMPLE, Item.EXTRACT or null if the plate can store mixed types
    • setBioMaterialType

      public void setBioMaterialType​(Item type)
      Set the type of biomaterial that can be stored on plates with this type. Valid values are Item.SAMPLE, Item.EXTRACT, and null. The value can't be changed after the plate type has been saved to the database.
      Parameters:
      type - A biomaterial item type or null
      Throws:
      PermissionDeniedException - If the logged in user doesn't have write permission or if the plate type has already been saved to the database
      InvalidDataException - If the type is not a biomaterial type
    • getItemSubtype

      public ItemSubtype getItemSubtype()
      Get the subtype that biomaterial items should have when placed on a plate with this bioplate type.
      Returns:
      A subtype or null if not important
      Since:
      3.0
    • setItemSubtype

      public void setItemSubtype​(ItemSubtype subtype)
      Set the subtype that biomaterial items should have when placed on a plate with the bioplate type. A subtype can only be specified if a biomaterial type has been set and the given subtype must be compatible with the biomaterial type.
      Parameters:
      subtype - A subtype or null if the subtype is not important
      Since:
      3.0
    • getStorageType

      public ItemSubtype getStorageType()
      Get the subtype of storage location where plates of this type are usually stored. The storage type should be a subtype for hardware items.
      Returns:
      A subtype or null if not important
      Since:
      3.2
    • setStorageType

      public void setStorageType​(ItemSubtype storageType)
      Set the subtype of storage location where plates of this type are usually stored. The storage type should be a subtype for hardware items.
      Parameters:
      storageType - A subtype or null if the subtype is not important
      Since:
      3.2
    • getLockMode

      public BioWell.LockMode getLockMode()
      Get the lock mode for wells located on plates of this plate type. The lock mode determines if biomaterial may be changed in the well.
      Returns:
      A lock mode
    • setLockMode

      public void setLockMode​(BioWell.LockMode lockMode)
      Set the lock mode for wells on plates of this plate type.
      Parameters:
      lockMode - A lock mode, null is not allowed
    • getBioPlates

      public ItemQuery<BioPlate> getBioPlates()
      Creates a query that returns all bioplates that are using this type.
      Returns:
      An ItemQuery object