Package net.sf.basedb.core
Class BioPlateEventType
java.lang.Object
net.sf.basedb.core.BasicItem
net.sf.basedb.core.BioPlateEventType
- All Implemented Interfaces:
AccessControlled
,Identifiable
,Nameable
,Removable
,SystemItem
public class BioPlateEventType extends BasicItem implements Nameable, Removable, SystemItem
The type of a bioplate event defines what happened in the event. A type is
usually coupled to a certain functionality in the client application.
- Since:
- 2.17
- Author:
- Nicklas
- Last modified
- $Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
-
Field Summary
Fields Modifier and Type Field 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.Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Fields inherited from interface net.sf.basedb.core.SystemItem
MAX_SYSTEM_ID_LENGTH
-
Constructor Summary
Constructors Constructor Description BioPlateEventType(BioPlateEventTypeData data)
-
Method Summary
Modifier and Type Method Description static BioPlateEventType
getById(DbControl dc, int id)
Gets a BioPlate event type when knowing the item's idstatic BioPlateEventType
getById(DbControl dc, String systemId)
Gets a BioPlate event type when knowing the item's system id(package private) BioPlateEventTypeData
getData()
Get theBasicData
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 allBioPlates
andBioPlateEventDefinitions
using this typeboolean
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 anyBioPlateEvents
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)
Methods inherited from class net.sf.basedb.core.BasicItem
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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
-
Field Details
-
TYPE
The type of item represented by this class.- See Also:
Item.BIOPLATEEVENTTYPE
,getType()
-
GENERIC
The system ID for "Generic" event type.- See Also:
- Constant Field Values
-
PLACE_ON_PLATE
The system ID for "Place-on-plate" event type.- See Also:
- Constant Field Values
-
MOVE
The system ID for "Move" event type.- See Also:
- Constant Field Values
-
CREATE_BIOMATERIAL
The system ID for "Create" event type.- See Also:
- Constant Field Values
-
PHYSICAL_BIOASSAY
The system ID for "Hybridization" event type.- See Also:
- Constant Field Values
-
-
Constructor Details
-
BioPlateEventType
BioPlateEventType(BioPlateEventTypeData data)
-
-
Method Details
-
getNew
public static BioPlateEventType getNew(DbControl dc, String systemId) throws BaseException, InvalidDataExceptionCreates a new bioplate event type.- Parameters:
dc
- DbControl used for database accesssystemId
- The system id to give to the event type (can't be changed later)- Returns:
- A new BioPlateEventType object
- Throws:
BaseException
- If anything goes wrong when creatingInvalidDataException
-
getById
public static BioPlateEventType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseExceptionGets a BioPlate event type when knowing the item's id- Parameters:
dc
- DbControl used for database accessid
- The item's id.- Returns:
BioPlateEventType
object- Throws:
ItemNotFoundException
- 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.
-
getById
public static BioPlateEventType getById(DbControl dc, String systemId) throws ItemNotFoundException, PermissionDeniedException, BaseExceptionGets a BioPlate event type when knowing the item's system id- Parameters:
dc
- DbControl used for database accesssystemId
- The item's system id.- Returns:
BioPlateEventType
object- Throws:
ItemNotFoundException
- 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.
-
getQuery
Gets query that returns bioplate event types.- Returns:
ItemQuery
object
-
getData
BioPlateEventTypeData getData()Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item. -
getType
Description copied from interface:Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in theItem
enumeration.- Specified by:
getType
in interfaceIdentifiable
- Returns:
- A value indicating the type of item
-
getName
Description copied from interface:Nameable
Get the name of the item. -
setName
Description copied from interface:Nameable
Set the name of the item. The name cannot be null and mustn't be longer than the value specified by theNameable.MAX_NAME_LENGTH
constant.- Specified by:
setName
in interfaceNameable
- Parameters:
name
- The new name for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the name is null or longer than specified by theNameable.MAX_NAME_LENGTH
constant
-
getDescription
Description copied from interface:Nameable
Get the description for the item.- Specified by:
getDescription
in interfaceNameable
- Returns:
- A
String
with a description of the item
-
setDescription
public void setDescription(String description) throws PermissionDeniedException, InvalidDataExceptionDescription copied from interface:Nameable
Set the description for the item. The description can be null but mustn't be longer than the value specified by theNameable.MAX_DESCRIPTION_LENGTH
constant.- Specified by:
setDescription
in interfaceNameable
- Parameters:
description
- The new description for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the description longer than specified by theNameable.MAX_DESCRIPTION_LENGTH
constant
-
isRemoved
public boolean isRemoved()Description copied from interface:Removable
Check if the removed flag is set for this item. -
setRemoved
Description copied from interface:Removable
Set the removed flag for this item.- Specified by:
setRemoved
in interfaceRemovable
- Parameters:
removed
- TRUE if the item should be flagged as removed, FALSE otherwise- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.DELETE
permission for setting the flag to TRUE orPermission.WRITE
permission for setting the flag to FALSE
-
getRemovedBy
Description copied from interface:Removable
Get the user that flagged this item for removal.- Specified by:
getRemovedBy
in interfaceRemovable
- Returns:
- A User object, or null if this item has not been flagged
- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission for the userItemNotFoundException
- If the user that removed this item can't be found
-
isUsed
public boolean isUsed()Check if there are anyBioPlateEvents
using this type.- Overrides:
isUsed
in classBasicItem
- Returns:
- TRUE if this item is used, FALSE otherwise
- See Also:
BasicItem.getUsingItems()
-
getUsingItems
Gets allBioPlates
andBioPlateEventDefinitions
using this type- Overrides:
getUsingItems
in classBasicItem
- Returns:
- A set containing proxies for the items, or an empty set if no items are using this item
- See Also:
BasicItem.addUsingItems(Set, Item, org.hibernate.query.Query)
-
onAfterInsert
Description copied from class:BasicItem
This method is called on all items directly after Hibernate has inserted it into the database. This method can be used in place of theBasicItem.onBeforeCommit(Transactional.Action)
in case the id is needed. The id has not been generated when theonBeforeCommit
is called.- Overrides:
onAfterInsert
in classBasicItem
- Throws:
BaseException
- If there is an error- See Also:
Transactional
, Developer documentation: Transactions, Developer documentation: Coding rules and guidelines for item classes
-
getSystemId
Description copied from interface:SystemItem
Get the system id for the item.- Specified by:
getSystemId
in interfaceSystemItem
- Returns:
- The id of the item or null if it is not a system item
-
isSystemItem
public boolean isSystemItem()Description copied from interface:SystemItem
Check if the item is a system item or not. A system item have a non-null value for the system id.- Specified by:
isSystemItem
in interfaceSystemItem
- Returns:
- TRUE if this item is a system item, FALSE otherwise
-
setSystemId
-