|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<D> net.sf.basedb.core.OwnedItem<D> net.sf.basedb.core.SharedItem<D> net.sf.basedb.core.CommonItem<D> net.sf.basedb.core.AnnotatedItem<D> net.sf.basedb.core.BioMaterial<D> net.sf.basedb.core.MeasuredBioMaterial<D>
public abstract class MeasuredBioMaterial<D extends MeasuredBioMaterialData>
This class is the base class for measured biomaterial items. A measured item is an item which can have original and remaining quantities associated with them.
The core keeps track of the remaining quantity whenever an item is used to create other items.
As it is, an item can be used when creating another item of the same type
(pooling) or when creating an item of the appropriate subtype, ie.
Sample -> Extract -> LabeledExtract
.
It is also possible to add a note using a BioMaterialEvent
saying that the quantity has been changed and why.
Field Summary | |
---|---|
private BioPlateEventParticipant |
bioPlateEventParticipant
|
private BioMaterialEvent |
creationEvent
|
Fields inherited from class net.sf.basedb.core.BioMaterial |
---|
MAX_EXTERNAL_ID_LENGTH |
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Constructor Summary | |
---|---|
MeasuredBioMaterial(D measuredBioMaterialData)
|
Method Summary | |
---|---|
BioWell |
getBioWell()
Get the well this biomaterial is located in. |
BioMaterialEvent |
getCreationEvent()
Get the event that represents the creation of this biomaterial. |
Date |
getEntryDate()
Get the date that the item was registered in the database. |
ItemQuery<BioMaterialEvent> |
getEvents()
Get a query that returns all events for this biomaterial. |
Float |
getOriginalQuantity()
Get the original quantity of the biomaterial. |
ItemQuery<BioMaterialEvent> |
getPoolingEvents()
Get a query that returns all events where this biomaterial has been used as a source. |
Protocol |
getProtocol()
Get the protocol from the creation event. |
Float |
getRemainingQuantity()
Get the remaining quantity of the biomaterial. |
Set<ItemProxy> |
getUsingItems()
Get all: BioMaterial :s where this item has been used as a source
|
boolean |
isInWell()
Check if this biomaterial is located in a well on a bioplate or not. |
boolean |
isLockedInWell()
Check if this biomaterial is placed in a well that it can't be removed from. |
boolean |
isPooled()
Check if this biomaterial was created by pooling or not. |
boolean |
isUsed()
Check that: no pooled biomaterial has been created from this item |
BioMaterialEvent |
newEvent()
Create a new event for this biomaterial. |
BioMaterialEvent |
newEvent(BioPlateEventParticipant master)
Create a new event for this biomaterial that is part of a master bioplate event. |
(package private) void |
onBeforeCommit(Transactional.Action action)
Make sure the creation event is created at the same time this item is created and that source biomaterials get their used quantities back if this item is deleted. |
(package private) void |
setBioPlateEventParticipant(BioPlateEventParticipant bioPlateEventParticipant)
|
void |
setBioWell(BioWell well)
Sets the BioWell where this biomaterial is located. |
void |
setOriginalQuantity(Float originalQuantity)
Set the original quantity of the biomaterial. |
void |
setPooled(boolean pooled)
Specify if this biomaterial was created by pooling or not. |
(package private) static void |
updateRemainingQuantity(DbControl dc,
MeasuredBioMaterialData bioMaterial,
Float usedQuantity)
Update the remaining quantity of a biomaterial. |
Methods inherited from class net.sf.basedb.core.BioMaterial |
---|
countChildren, getById, getExternalId, setExternalId |
Methods inherited from class net.sf.basedb.core.AnnotatedItem |
---|
getAnnotationSet, isAnnotated, removeAnnotations, toTransferable |
Methods inherited from class net.sf.basedb.core.CommonItem |
---|
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable |
Methods inherited from class net.sf.basedb.core.SharedItem |
---|
getItemKey, getProjectKey, initPermissions, isShared, setItemKey, setProjectKey, toTransferable |
Methods inherited from class net.sf.basedb.core.OwnedItem |
---|
getOwner, isOwner, setOwner, takeOwnership, toTransferable |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, 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, getType, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Methods inherited from interface net.sf.basedb.core.Annotatable |
---|
getAnnotatableParents |
Methods inherited from interface net.sf.basedb.core.Ownable |
---|
getOwner, isOwner, setOwner, takeOwnership |
Field Detail |
---|
private BioPlateEventParticipant bioPlateEventParticipant
private BioMaterialEvent creationEvent
Constructor Detail |
---|
MeasuredBioMaterial(D measuredBioMaterialData)
Method Detail |
---|
public boolean isUsed() throws BaseException
isUsed
in class BasicItem<D extends MeasuredBioMaterialData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
BioMaterial
:s where this item has been used as a source
getUsingItems
in class BasicItem<D extends MeasuredBioMaterialData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
void onBeforeCommit(Transactional.Action action) throws BaseException
onBeforeCommit
in class BioMaterial<D extends MeasuredBioMaterialData>
BaseException
- If there is another errorTransactional
,
Core API overview - Transaction handling,
Coding rules and guidelines for item classespublic Protocol getProtocol()
getProtocol
in interface Annotatable
getProtocol
in class AnnotatedItem<D extends MeasuredBioMaterialData>
public Date getEntryDate()
Registered
getEntryDate
in interface Registered
public BioMaterialEvent getCreationEvent() throws PermissionDeniedException, BaseException
BioMaterialEvent
data.
PermissionDeniedException
- If logged in user doesn't have read permission on the biomaterial.
BaseException
- If there is some other error.void setBioPlateEventParticipant(BioPlateEventParticipant bioPlateEventParticipant)
public Float getOriginalQuantity()
Float
holding the original quantity, or null
if not knownpublic void setOriginalQuantity(Float originalQuantity) throws PermissionDeniedException, InvalidDataException, BaseException
originalQuantity
- The new value for the original quantity, or
null if not known
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the original quantity is below zero
BaseException
- If there is some other kind of error.public Float getRemainingQuantity()
newEvent()
method to get an event object where you
can specify the used quantity.
Float
holding the remaining quantity or null
if not knownstatic void updateRemainingQuantity(DbControl dc, MeasuredBioMaterialData bioMaterial, Float usedQuantity)
usedQuantity
parameter is null or if the remaining
quantity is null.
public boolean isPooled()
public void setPooled(boolean pooled) throws PermissionDeniedException, BaseException
pooled
- set to TRUE if pooled, FALSE otherwise.
PermissionDeniedException
- If the logged in user doesn't have
write permission
BaseException
- If there is another errorBioMaterialEvent.getSources()
public BioMaterialEvent newEvent() throws PermissionDeniedException, BaseException
BioMaterialEvent
object.
PermissionDeniedException
- If the logged in user doesn't have
use permission for this biomaterial
BaseException
- If there is another errorpublic BioMaterialEvent newEvent(BioPlateEventParticipant master) throws PermissionDeniedException, BaseException
BioMaterialEvent
object.
PermissionDeniedException
- If the logged in user doesn't have
use permission for this biomaterial
BaseException
- If there is another errorpublic ItemQuery<BioMaterialEvent> getEvents()
ItemQuery
objectpublic ItemQuery<BioMaterialEvent> getPoolingEvents()
ItemQuery
objectpublic void setBioWell(BioWell well) throws PermissionDeniedException, BaseException
BioWell
where this biomaterial is located.
well
- The BioWell
to set.
ItemInUseException
- If the well is already used by another
biomaterial
PermissionDeniedException
- If logged in user doesn't have
Permission.WRITE
for this MeasuredBioMaterial or
Permission.USE
for the BioWell.
BaseException
- If there is another error.public BioWell getBioWell()
public boolean isInWell()
public boolean isLockedInWell()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |