public class BioSource extends BioMaterial implements Registered
Sample
:s.Modifier and Type | Field and Description |
---|---|
static Item |
TYPE
The type of item represented by this class.
|
MAX_EXTERNAL_ID_LENGTH
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
BioSource(BioSourceData bioSourceData) |
Modifier and Type | Method and Description |
---|---|
long |
countChildren(boolean pooled)
Count the number of child samples.
|
long |
countSamples()
Counts all samples that have been created from this biosource.
|
static BioSource |
getById(DbControl dc,
int id)
Get an
BioSource item when you know the id. |
(package private) BioSourceData |
getData()
Get the
BasicData object that holds all data for this item. |
Date |
getEntryDate()
Get the date that the item was registered in the database.
|
static BioSource |
getNew(DbControl dc)
Create a new
BioSource item. |
static ItemQuery<BioSource> |
getQuery()
Get a query that returns biosource items.
|
ItemQuery<Sample> |
getSamples()
Get a query that returns all samples created from this biosource.
|
Item |
getType()
Get the type of item represented by the object.
|
Set<ItemProxy> |
getUsingItems()
Get all:
Sample :s created from this biosource
|
boolean |
isUsed()
Check that:
no
Sample has been created from this biosource
|
Sample |
newSample()
Create a new
Sample from this biosource. |
getAnnotatableParents, getChildCreationEvents, getExternalId, getItemSubtype, setExternalId, setItemSubtype
getAnnotationSet, getProtocol, isAnnotated, removeAnnotations
getDescription, getName, getRemovedBy, isRemoved, setDescription, setName, setRemoved
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addAnnotatableParents, addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
getDescription, getName, setDescription, setName
getOwner, isOwner, setOwner, takeOwnership
public static final Item TYPE
Item.BIOSOURCE
,
getType()
BioSource(BioSourceData bioSourceData)
public static BioSource getNew(DbControl dc) throws BaseException
BioSource
item.dc
- The DbControl
which will be used for
permission checking and database accessBioSource
itemBaseException
- If there is an errorpublic static BioSource getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
BioSource
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 loadBioSource
itemItemNotFoundException
- If an item with the specified
id is not foundPermissionDeniedException
- If the logged in user doesn't
have read permission to the itemBaseException
- If there is another errorpublic static ItemQuery<BioSource> getQuery()
ItemQuery
object.BioSourceData getData()
BasicItem
BasicData
object that holds all data for this item.getData
in class BioMaterial
public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public Date getEntryDate()
Registered
getEntryDate
in interface Registered
public boolean isUsed() throws BaseException
Sample
has been created from this biosource
isUsed
in class BasicItem
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
Sample
:s created from this biosource
getUsingItems
in class BasicItem
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public Sample newSample() throws PermissionDeniedException, BaseException
Sample
from this biosource.Sample
itemPermissionDeniedException
- If the logged in user doesn't have
use permission for this biosourceBaseException
- If there is another errorpublic ItemQuery<Sample> getSamples()
ItemQuery
objectpublic long countSamples() throws BaseException
BaseException
- If counting the samples fails.public long countChildren(boolean pooled)
countChildren
in class BioMaterial
pooled
- If TRUE, the count is for biomaterials of the same type,
if FALSE the count is for biomaterials of the child type