public abstract class BioMaterial<D extends BioMaterialData> extends AnnotatedItem<D> implements Subtypable
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(D bioMaterialData) |
Modifier and Type | Method and Description |
---|---|
abstract long |
countChildren(boolean pooled)
Count the number of already existing children to this biomaterial.
|
java.util.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.
|
java.lang.String |
getExternalId()
Get the external id of the biomaterial.
|
ItemSubtype |
getItemSubtype()
Get the subtype of the item.
|
(package private) void |
onBeforeCommit(Transactional.Action action)
On delete action: issue an update to decrease the size of all
BioMaterialList :s this is a member of. |
void |
setExternalId(java.lang.String externalId)
Set the external id of the biomaterial.
|
void |
setItemSubtype(ItemSubtype subtype)
Set the subtype on the item.
|
getAnnotationSet, getProtocol, isAnnotated, removeAnnotations, toTransferable
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable
getItemKey, getProjectKey, initPermissions, isShared, setItemKey, setProjectKey, toTransferable
getOwner, isOwner, setOwner, takeOwnership, toTransferable
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getType, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
,
Constant Field ValuesBioMaterial(D 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 errorpublic 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 java.util.Set<Annotatable> getAnnotatableParents() throws BaseException
ItemSubtype.getPushAnnotations()
flag set.getAnnotatableParents
in interface Annotatable
BaseException
- If there is an errorvoid onBeforeCommit(Transactional.Action action) throws NotLoggedInException, BaseException
BioMaterialList
:s this is a member of.onBeforeCommit
in class SharedItem<D extends BioMaterialData>
NotLoggedInException
- If no user is logged inBaseException
- If there is another errorTransactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classespublic java.lang.String getExternalId()
public void setExternalId(java.lang.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()