public abstract class BioMaterial extends AnnotatedItem implements Subtypable, Listable
Modifier and Type | Field and Description |
---|---|
static int |
MAX_EXTERNAL_ID_LENGTH
The maximum length of the external id that can be stored in the database.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
BioMaterial(BioMaterialData bioMaterialData) |
Modifier and Type | Method and Description |
---|---|
abstract long |
countChildren(boolean pooled)
Count the number of already existing children to this biomaterial.
|
Set<Annotatable> |
getAnnotatableParents()
Get all child biomaterial items with a subtype that
has the
ItemSubtype.getPushAnnotations() flag set. |
static BioMaterial |
getById(DbControl dc,
int id)
Get a biomaterial item when you know the id.
|
SpecialQuery<BioMaterialEventSource> |
getChildCreationEvents()
Get a query returning all events where this biomaterial has been used
as a source item.
|
(package private) BioMaterialData |
getData()
Get the
BasicData object that holds all data for this item. |
String |
getExternalId()
Get the external id of the biomaterial.
|
ItemSubtype |
getItemSubtype()
Get the subtype of the item.
|
void |
setExternalId(String externalId)
Set the external id of the biomaterial.
|
void |
setItemSubtype(ItemSubtype subtype)
Set the subtype on the item.
|
getAnnotationSet, getProtocol, isAnnotated, removeAnnotations
getDescription, getName, isRemoved, setDescription, setName, setRemoved
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDescription, getName, setDescription, setName
getId, getType, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
,
Constant Field ValuesBioMaterial(BioMaterialData bioMaterialData)
public static BioMaterial getById(DbControl dc, int id)
BioMaterial
. Eg. BioSource
,
Sample
or Extract
.dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to loadSample
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 errorBioMaterialData getData()
BasicItem
BasicData
object that holds all data for this item.getData
in class AnnotatedItem
public ItemSubtype getItemSubtype()
Subtypable
getItemSubtype
in interface Subtypable
SubtypableRelatedItems
public void setItemSubtype(ItemSubtype subtype)
Subtypable
setItemSubtype
in interface Subtypable
subtype
- A subtype or nullItemSubtype.setOnItem(Subtypable)
public Set<Annotatable> getAnnotatableParents() throws BaseException
ItemSubtype.getPushAnnotations()
flag set.getAnnotatableParents
in interface Annotatable
BaseException
- If there is an errorpublic String getExternalId()
public void setExternalId(String externalId) throws PermissionDeniedException, InvalidDataException
MAX_EXTERNAL_ID_LENGTH
constant.externalId
- The new value for the external idPermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the string is too longpublic abstract long countChildren(boolean pooled)
pooled
- If TRUE, the count is for biomaterials of the same type,
if FALSE the count is for biomaterials of the child typepublic SpecialQuery<BioMaterialEventSource> getChildCreationEvents()