2.17.2: 2011-06-17

net.sf.basedb.core
Class BioPlateEventType

java.lang.Object
  extended by net.sf.basedb.core.BasicItem<BioPlateEventTypeData>
      extended by net.sf.basedb.core.BioPlateEventType
All Implemented Interfaces:
AccessControlled, Identifiable, Nameable, Removable, SystemItem

public class BioPlateEventType
extends BasicItem<BioPlateEventTypeData>
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: 2011-01-31 10:51:00 +0100 (Mon, 31 Jan 2011) $

Field Summary
static String CREATE_BIOMATERIAL
          The system ID for "Create" event type.
static String GENERIC
          The system ID for "Generic" event type.
static String HYBRIDIZATION
          The system ID for "Hybridization" event type.
static String MOVE
          The system ID for "Move" 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
BioPlateEventType(BioPlateEventTypeData data)
           
 
Method Summary
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
 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.
 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)
           
 
Methods inherited from class net.sf.basedb.core.BasicItem
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, initPermissions, isDetached, isInDatabase, onAfterCommit, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
 
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
 

Field Detail

TYPE

public static final Item TYPE
The type of item represented by this class.

See Also:
Item.BIOPLATEEVENTTYPE, getType()

GENERIC

public static final String GENERIC
The system ID for "Generic" event type.

See Also:
Constant Field Values

PLACE_ON_PLATE

public static final String PLACE_ON_PLATE
The system ID for "Place-on-plate" event type.

See Also:
Constant Field Values

MOVE

public static final String MOVE
The system ID for "Move" event type.

See Also:
Constant Field Values

CREATE_BIOMATERIAL

public static final String CREATE_BIOMATERIAL
The system ID for "Create" event type.

See Also:
Constant Field Values

HYBRIDIZATION

public static final String HYBRIDIZATION
The system ID for "Hybridization" event type.

See Also:
Constant Field Values
Constructor Detail

BioPlateEventType

BioPlateEventType(BioPlateEventTypeData data)
Method Detail

getNew

public static BioPlateEventType getNew(DbControl dc,
                                       String systemId)
                                throws BaseException,
                                       InvalidDataException
Creates a new bioplate event type.

Parameters:
dc - DbControl used for database access
systemId - 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 creating
InvalidDataException

getById

public static BioPlateEventType getById(DbControl dc,
                                        int id)
                                 throws ItemNotFoundException,
                                        PermissionDeniedException,
                                        BaseException
Gets a BioPlate event type when knowing the item's id

Parameters:
dc - DbControl used for database access
id - The item's id.
Returns:
BioPlateEventType object
Throws:
ItemNotFoundException - If no item with the given id was found
PermissionDeniedException - If logged in user doesn't have read permission to the requested item
BaseException - If there is another error.

getById

public static BioPlateEventType getById(DbControl dc,
                                        String systemId)
                                 throws ItemNotFoundException,
                                        PermissionDeniedException,
                                        BaseException
Gets a BioPlate event type when knowing the item's system id

Parameters:
dc - DbControl used for database access
systemId - The item's system id.
Returns:
BioPlateEventType object
Throws:
ItemNotFoundException - If no item with the given id was found
PermissionDeniedException - If logged in user doesn't have read permission to the requested item
BaseException - If there is another error.

getQuery

public static ItemQuery<BioPlateEventType> getQuery()
Gets query that returns bioplate event types.

Returns:
ItemQuery object

getType

public 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 the Item enumeration.

Specified by:
getType in interface Identifiable
Returns:
A value indicating the type of item

getName

public String getName()
Description copied from interface: Nameable
Get the name of the item.

Specified by:
getName in interface Nameable
Returns:
A String with the name of the item

setName

public void setName(String name)
             throws PermissionDeniedException,
                    InvalidDataException
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 the Nameable.MAX_NAME_LENGTH constant.

Specified by:
setName in interface Nameable
Parameters:
name - The new name for the item
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
InvalidDataException - If the name is null or longer than specified by the Nameable.MAX_NAME_LENGTH constant

getDescription

public String getDescription()
Description copied from interface: Nameable
Get the description for the item.

Specified by:
getDescription in interface Nameable
Returns:
A String with a description of the item

setDescription

public void setDescription(String description)
                    throws PermissionDeniedException,
                           InvalidDataException
Description 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 the Nameable.MAX_DESCRIPTION_LENGTH constant.

Specified by:
setDescription in interface Nameable
Parameters:
description - The new description for the item
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
InvalidDataException - If the description longer than specified by the Nameable.MAX_DESCRIPTION_LENGTH constant

isRemoved

public boolean isRemoved()
Description copied from interface: Removable
Check if the removed flag is set for this item.

Specified by:
isRemoved in interface Removable
Returns:
TRUE if the item is flagged as removed, FALSE otherwise

setRemoved

public void setRemoved(boolean removed)
                throws PermissionDeniedException
Description copied from interface: Removable
Set the removed flag for this item.

Specified by:
setRemoved in interface Removable
Parameters:
removed - TRUE if the item should be flagged as removed, FALSE otherwise
Throws:
PermissionDeniedException - 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 FALSE

isUsed

public boolean isUsed()
Check if there are any BioPlateEvents using this type.

Overrides:
isUsed in class BasicItem<BioPlateEventTypeData>
Returns:
TRUE if this item is used, FALSE otherwise
See Also:
BasicItem.getUsingItems()

getUsingItems

public Set<ItemProxy> getUsingItems()
Gets all BioPlates and BioPlateEventDefinitions using this type

Overrides:
getUsingItems in class BasicItem<BioPlateEventTypeData>
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)

onAfterInsert

void onAfterInsert()
             throws BaseException
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 the BasicItem.onBeforeCommit(Transactional.Action) in case the id is needed. The id has not been generated when the onBeforeCommit is called.

Overrides:
onAfterInsert in class BasicItem<BioPlateEventTypeData>
Throws:
BaseException - If there is an error
See Also:
Transactional, Core API overview - Transaction handling, Coding rules and guidelines for item classes

getSystemId

public String getSystemId()
Description copied from interface: SystemItem
Get the system id for the item.

Specified by:
getSystemId in interface SystemItem
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 interface SystemItem
Returns:
TRUE if this item is a system item, FALSE otherwise

setSystemId

void setSystemId(String systemId)

2.17.2: 2011-06-17