|
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<SampleData> net.sf.basedb.core.Sample
public class Sample
This class is used to represent sample items. A sample is the
actual sample taken from a BioSource
. A sample
can also be created by combining other samples into a new sample.
A process is known as pooling. It is also possible to create
standalone samples, with no reference to a biosource or to other
samples.
Field Summary | |
---|---|
static Item |
TYPE
The type of item represented by this class. |
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 | |
---|---|
Sample(SampleData sampleData)
|
Method Summary | |
---|---|
long |
countChildren(boolean pooled)
Count the number of child samples or extracts. |
long |
countExtracts()
Counts all extracts that have been created from this sample. |
long |
countSamples()
Counts all samples that have been created from this sample. |
Set<Annotatable> |
getAnnotatableParents()
Get the biosource or pooled samples. |
BioSource |
getBioSource()
Get the BioSource that is the parent of this sample. |
static Sample |
getById(DbControl dc,
int id)
Get an Sample item when you know the id. |
ItemQuery<Sample> |
getChildSamples()
Creates a query that returns all child (pooled) samples that has this sample as one of it's sources. |
ItemQuery<Extract> |
getExtracts()
Get a query that returns all extracts created from this sample. |
static Sample |
getNew(DbControl dc)
Create a new Sample item. |
static Sample |
getNew(DbControl dc,
BioPlateEventParticipant master)
Create a new Sample item as part of a
master bioplate event. |
static ItemQuery<Sample> |
getQuery()
Get a query that returns samples. |
Item |
getType()
Get the type of item represented by the object. |
Set<ItemProxy> |
getUsingItems()
Get all: Extract :s created from this sample
Pooled samples
|
boolean |
isUsed()
Check that: no Extract :s has been created from this item
no Sample :s has been created from this item
|
Extract |
newExtract(Float usedQuantity)
Create a new Extract from this sample. |
Extract |
newExtract(Float usedQuantity,
BioPlateEventParticipant master)
Create a new Extract from this sample as part of a
master bioplate event. |
void |
setBioSource(BioSource bioSource)
Set the BioSource item that is the parent
of this sample. |
Methods inherited from class net.sf.basedb.core.MeasuredBioMaterial |
---|
getBioWell, getCreationEvent, getEntryDate, getEvents, getOriginalQuantity, getPoolingEvents, getProtocol, getRemainingQuantity, isInWell, isLockedInWell, isPooled, newEvent, newEvent, onBeforeCommit, setBioPlateEventParticipant, setBioWell, setOriginalQuantity, setPooled, updateRemainingQuantity |
Methods inherited from class net.sf.basedb.core.BioMaterial |
---|
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, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Methods inherited from interface net.sf.basedb.core.Ownable |
---|
getOwner, isOwner, setOwner, takeOwnership |
Field Detail |
---|
public static final Item TYPE
Item.SAMPLE
,
getType()
Constructor Detail |
---|
Sample(SampleData sampleData)
Method Detail |
---|
public static Sample getNew(DbControl dc) throws BaseException
Sample
item.
dc
- The DbControl
which will be used for
permission checking and database access
Sample
item
BaseException
- If there is an errorpublic static Sample getNew(DbControl dc, BioPlateEventParticipant master) throws BaseException
Sample
item as part of a
master bioplate event.
dc
- The DbControl
which will be used for
permission checking and database accessmaster
- The master bioplate event participant or null
Sample
item
BaseException
- If there is an errorpublic static Sample getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Sample
item when you know the id.
dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to load
Sample
item
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 errorpublic static ItemQuery<Sample> getQuery()
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.
public Set<Annotatable> getAnnotatableParents() throws BaseException
BaseException
- If there is an errorpublic boolean isUsed() throws BaseException
isUsed
in class MeasuredBioMaterial<SampleData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
Extract
:s created from this sample
getUsingItems
in class MeasuredBioMaterial<SampleData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public BioSource getBioSource() throws PermissionDeniedException, BaseException
BioSource
that is the parent of this sample.
BioSource
object or null if this is a pooled or
standalone sample
PermissionDeniedException
- If the logged in user doesn't have read
permission for the biosource
BaseException
- If there is another errorpublic void setBioSource(BioSource bioSource) throws PermissionDeniedException, InvalidDataException
BioSource
item that is the parent
of this sample.
bioSource
- The parent BioSource
item
PermissionDeniedException
- If the logged in user doesn't have
write permission for this sample or use permission for the biosource
InvalidDataException
- If this is a pooled sample
BaseException
- If there is another errorpublic Extract newExtract(Float usedQuantity) throws PermissionDeniedException, BaseException
Extract
from this sample.
usedQuantity
- The quantity used from this sample or null
if not known
Extract
item
PermissionDeniedException
- If the logged in user doesn't have
use permission for this sample
BaseException
- If there is another errorpublic Extract newExtract(Float usedQuantity, BioPlateEventParticipant master) throws PermissionDeniedException, BaseException
Extract
from this sample as part of a
master bioplate event.
usedQuantity
- The quantity used from this sample or null
if not knownmaster
- The master bioplate event participant or null
Extract
item
PermissionDeniedException
- If the logged in user doesn't have
use permission for this sample
BaseException
- If there is another errorpublic ItemQuery<Extract> getExtracts() throws BaseException
ItemQuery
object
BaseException
- If the query couldn't be created.public ItemQuery<Sample> getChildSamples()
public long countExtracts() throws BaseException
BaseException
- If there is some kind of error.public long countSamples() throws BaseException
BaseException
- If there is some kind of error.public long countChildren(boolean pooled)
countChildren
in class BioMaterial<SampleData>
pooled
- TRUE = count child samples, FALSE = count child extracts
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |