2.17.2: 2011-06-17

net.sf.basedb.core
Class BioPlateType

java.lang.Object
  extended by net.sf.basedb.core.BasicItem<BioPlateTypeData>
      extended by net.sf.basedb.core.BioPlateType
All Implemented Interfaces:
AccessControlled, Identifiable, Nameable, Removable

public class BioPlateType
extends BasicItem<BioPlateTypeData>
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: 2010-10-28 14:12:26 +0200 (Thu, 28 Oct 2010) $

Field Summary
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
BioPlateType(BioPlateTypeData data)
           
 
Method Summary
 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
 String getDescription()
          Get the description for the item.
 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 bioplates
 Item getType()
          Get the type of item represented by the object.
 Set<ItemProxy> getUsingItems()
          Gets all BioPlates and BioPlateEventDefinitions using this type
 boolean isRemoved()
          Check if the removed flag is set for this item.
 boolean isUsed()
          Check if there are any BioPlates or BioPlateEventDefinitions 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 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.
 
Methods inherited from class net.sf.basedb.core.BasicItem
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, initPermissions, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
 
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
 

Field Detail

TYPE

public static final Item TYPE
The type of item represented by this class.

See Also:
Item.BIOPLATETYPE, getType()
Constructor Detail

BioPlateType

BioPlateType(BioPlateTypeData data)
Method Detail

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

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

isUsed

public boolean isUsed()
Check if there are any BioPlates or BioPlateEventDefinitions using this type.

Overrides:
isUsed in class BasicItem<BioPlateTypeData>
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<BioPlateTypeData>
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)

getBioMaterialType

public Item getBioMaterialType()
Get the biomaterial type that can be stored on plates of this type.

Returns:
One of Item.SAMPLE, Item.EXTRACT, Item.LABELEDEXTRACT 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, Item.LABELEDEXTRACT 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

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

2.17.2: 2011-06-17