public class BioPlateEventType extends BasicItem implements Nameable, Removable, SystemItem
Modifier and Type | Field and Description |
---|---|
static String |
CREATE_BIOMATERIAL
The system ID for "Create" event type.
|
static String |
GENERIC
The system ID for "Generic" event type.
|
static String |
MOVE
The system ID for "Move" event type.
|
static String |
PHYSICAL_BIOASSAY
The system ID for "Hybridization" event type.
|
static String |
PLACE_ON_PLATE
The system ID for "Place-on-plate" event type.
|
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
MAX_SYSTEM_ID_LENGTH
Constructor and Description |
---|
BioPlateEventType(BioPlateEventTypeData data) |
Modifier and Type | Method and Description |
---|---|
static BioPlateEventType |
getById(DbControl dc,
int id)
Gets a BioPlate event type when knowing the item's id
|
static BioPlateEventType |
getById(DbControl dc,
String systemId)
Gets a BioPlate event type when knowing the item's system id
|
(package private) BioPlateEventTypeData |
getData()
Get the
BasicData object that holds all data for this item. |
String |
getDescription()
Get the description for the item.
|
String |
getName()
Get the name of the item.
|
static BioPlateEventType |
getNew(DbControl dc,
String systemId)
Creates a new bioplate event type.
|
static ItemQuery<BioPlateEventType> |
getQuery()
Gets query that returns bioplate event types.
|
User |
getRemovedBy()
Get the user that flagged this item for removal.
|
String |
getSystemId()
Get the system id for the item.
|
Item |
getType()
Get the type of item represented by the object.
|
Set<ItemProxy> |
getUsingItems()
Gets all
BioPlates and BioPlateEventDefinitions
using this type |
boolean |
isRemoved()
Check if the removed flag is set for this item.
|
boolean |
isSystemItem()
Check if the item is a system item or not.
|
boolean |
isUsed()
Check if there are any
BioPlateEvents using this type. |
(package private) void |
onAfterInsert()
This method is called on all items directly after Hibernate has inserted
it into the database.
|
void |
setDescription(String description)
Set the description for the item.
|
void |
setName(String name)
Set the name of the item.
|
void |
setRemoved(boolean removed)
Set the removed flag for this item.
|
(package private) void |
setSystemId(String systemId) |
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, initPermissions, isDetached, isInDatabase, onAfterCommit, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
public static final Item TYPE
Item.BIOPLATEEVENTTYPE
,
getType()
public static final String GENERIC
public static final String PLACE_ON_PLATE
public static final String MOVE
public static final String CREATE_BIOMATERIAL
public static final String PHYSICAL_BIOASSAY
BioPlateEventType(BioPlateEventTypeData data)
public static BioPlateEventType getNew(DbControl dc, String systemId) throws BaseException, InvalidDataException
dc
- DbControl used for database accesssystemId
- The system id to give to the event type (can't be changed later)BaseException
- If anything goes wrong when creatingInvalidDataException
public static BioPlateEventType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
dc
- DbControl used for database accessid
- The item's id.BioPlateEventType
objectItemNotFoundException
- If no item with the given id was foundPermissionDeniedException
- If logged in user doesn't have read
permission to the requested itemBaseException
- If there is another error.public static BioPlateEventType getById(DbControl dc, String systemId) throws ItemNotFoundException, PermissionDeniedException, BaseException
dc
- DbControl used for database accesssystemId
- The item's system id.BioPlateEventType
objectItemNotFoundException
- If no item with the given id was foundPermissionDeniedException
- If logged in user doesn't have read
permission to the requested itemBaseException
- If there is another error.public static ItemQuery<BioPlateEventType> getQuery()
ItemQuery
objectBioPlateEventTypeData getData()
BasicItem
BasicData
object that holds all data for this item.public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public String getName()
Nameable
public void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.setName
in interface Nameable
name
- The new name for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.setDescription
in interface Nameable
description
- The new description for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic boolean isRemoved()
Removable
public void setRemoved(boolean removed) throws PermissionDeniedException
Removable
setRemoved
in interface Removable
removed
- TRUE if the item should be flagged as removed,
FALSE otherwisePermissionDeniedException
- If the logged in user doesn't
have Permission.DELETE
permission for setting the flag
to TRUE or Permission.WRITE
permission for setting the
flag to FALSEpublic User getRemovedBy() throws PermissionDeniedException, ItemNotFoundException
Removable
getRemovedBy
in interface Removable
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the userItemNotFoundException
- If the user that removed this item
can't be foundpublic boolean isUsed()
BioPlateEvents
using this type.isUsed
in class BasicItem
BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
BioPlates
and BioPlateEventDefinitions
using this typegetUsingItems
in class BasicItem
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
void onAfterInsert() throws BaseException
BasicItem
BasicItem.onBeforeCommit(Transactional.Action)
in case the id is needed. The id
has not been generated when the onBeforeCommit
is called.onAfterInsert
in class BasicItem
BaseException
- If there is an errorTransactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classespublic String getSystemId()
SystemItem
getSystemId
in interface SystemItem
public boolean isSystemItem()
SystemItem
isSystemItem
in interface SystemItem
void setSystemId(String systemId)