Package net.sf.basedb.core
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 Summary
Fields Modifier and Type Field Description static Item
TYPE
The type of item represented by this class.Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
Constructor Summary
Constructors Constructor Description BioPlateType(BioPlateTypeData data)
-
Method Summary
Modifier and Type Method Description Item
getBioMaterialType()
Get the biomaterial type that can be stored on plates of this type.ItemQuery<BioPlate>
getBioPlates()
Creates a query that returns all bioplates that are using this type.static BioPlateType
getById(DbControl dc, int id)
Gets a BioPlate type when knowing the item's id(package private) BioPlateTypeData
getData()
Get theBasicData
object that holds all data for this item.String
getDescription()
Get the description for the item.ItemSubtype
getItemSubtype()
Get the subtype that biomaterial items should have when placed on a plate with this bioplate type.BioWell.LockMode
getLockMode()
Get the lock mode for wells located on plates of this plate type.String
getName()
Get the name of the item.static BioPlateType
getNew(DbControl dc)
Creates a new bioplate type.static ItemQuery<BioPlateType>
getQuery()
Gets query that selects all available bioplatesUser
getRemovedBy()
Get the user that flagged this item for removal.ItemSubtype
getStorageType()
Get the subtype of storage location where plates of this type are usually stored.Item
getType()
Get the type of item represented by the object.Set<ItemProxy>
getUsingItems()
Gets allBioPlates
andBioPlateEventDefinitions
using this typeboolean
isRemoved()
Check if the removed flag is set for this item.boolean
isUsed()
Check if there are anyBioPlates
orBioPlateEventDefinitions
using this type.void
setBioMaterialType(Item type)
Set the type of biomaterial that can be stored on plates with this type.void
setDescription(String description)
Set the description for the item.void
setItemSubtype(ItemSubtype subtype)
Set the subtype that biomaterial items should have when placed on a plate with the bioplate type.void
setLockMode(BioWell.LockMode lockMode)
Set the lock mode for wells on plates of this plate type.void
setName(String name)
Set the name of the item.void
setRemoved(boolean removed)
Set the removed flag for this item.void
setStorageType(ItemSubtype storageType)
Set the subtype of storage location where plates of this type are usually stored.Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, initPermissions, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
-
Field Details
-
TYPE
The type of item represented by this class.- See Also:
Item.BIOPLATETYPE
,getType()
-
-
Constructor Details
-
BioPlateType
BioPlateType(BioPlateTypeData data)
-
-
Method Details
-
getNew
Creates a new bioplate type.- Parameters:
dc
- DbControl used for database access- Returns:
- A new BioPlate object
- Throws:
BaseException
- If anything goes wrong when creatingInvalidDataException
-
getById
public static BioPlateType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseExceptionGets a BioPlate type when knowing the item's id- Parameters:
dc
- DbControl used for database accessid
- The item's id.- Returns:
BioPlateType
object- Throws:
ItemNotFoundException
- If no item with the given id was foundPermissionDeniedException
- If logged in user doesn't have read permission to the requested itemBaseException
- If there is another error.
-
getQuery
Gets query that selects all available bioplates- Returns:
ItemQuery
object
-
getData
BioPlateTypeData getData()Description copied from class:BasicItem
Get theBasicData
object that holds all data for this 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 theItem
enumeration.- Specified by:
getType
in interfaceIdentifiable
- Returns:
- A value indicating the type of item
-
getName
Description copied from interface:Nameable
Get the name of the item. -
setName
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 theNameable.MAX_NAME_LENGTH
constant.- Specified by:
setName
in interfaceNameable
- Parameters:
name
- The new name for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the name is null or longer than specified by theNameable.MAX_NAME_LENGTH
constant
-
getDescription
Description copied from interface:Nameable
Get the description for the item.- Specified by:
getDescription
in interfaceNameable
- Returns:
- A
String
with a description of the item
-
setDescription
public void setDescription(String description) throws PermissionDeniedException, InvalidDataExceptionDescription 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 theNameable.MAX_DESCRIPTION_LENGTH
constant.- Specified by:
setDescription
in interfaceNameable
- Parameters:
description
- The new description for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the description longer than specified by theNameable.MAX_DESCRIPTION_LENGTH
constant
-
isRemoved
public boolean isRemoved()Description copied from interface:Removable
Check if the removed flag is set for this item. -
setRemoved
Description copied from interface:Removable
Set the removed flag for this item.- Specified by:
setRemoved
in interfaceRemovable
- Parameters:
removed
- TRUE if the item should be flagged as removed, FALSE otherwise- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.DELETE
permission for setting the flag to TRUE orPermission.WRITE
permission for setting the flag to FALSE
-
getRemovedBy
Description copied from interface:Removable
Get the user that flagged this item for removal.- Specified by:
getRemovedBy
in interfaceRemovable
- Returns:
- A User object, or null if this item has not been flagged
- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission for the userItemNotFoundException
- If the user that removed this item can't be found
-
isUsed
public boolean isUsed()Check if there are anyBioPlates
orBioPlateEventDefinitions
using this type.- Overrides:
isUsed
in classBasicItem
- Returns:
- TRUE if this item is used, FALSE otherwise
- See Also:
BasicItem.getUsingItems()
-
getUsingItems
Gets allBioPlates
andBioPlateEventDefinitions
using this type- Overrides:
getUsingItems
in classBasicItem
- 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
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
Set the type of biomaterial that can be stored on plates with this type. Valid values areItem.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 databaseInvalidDataException
- If the type is not a biomaterial type
-
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
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
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
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
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
Set the lock mode for wells on plates of this plate type.- Parameters:
lockMode
- A lock mode, null is not allowed
-
getBioPlates
Creates a query that returns all bioplates that are using this type.- Returns:
- An ItemQuery object
-