Last update: 2011-06-23

org.proteios.core
Class UpdateEvent

java.lang.Object
  extended by org.proteios.core.BasicItem<D>
      extended by org.proteios.core.BioMaterialEvent<UpdateEventData>
          extended by org.proteios.core.UpdateEvent
All Implemented Interfaces:
AccessControlled, Identifiable

public class UpdateEvent
extends BioMaterialEvent<UpdateEventData>

This class represent UpdateEvent items. An UpdateEvent has information about a change in measured biomaterial in an experiment.

Version:
2.0
Author:
Olle
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

Field Summary
static Item TYPE
          The type of item represented by this class.
 
Fields inherited from class org.proteios.core.BioMaterialEvent
MAX_COMMENT_LENGTH
 
Method Summary
 void addUpdateComment(MeasuredBioMaterial measuredBioMaterial, MeasuredBioMaterial oldMeasuredBioMaterial)
          Adds an update event comment with info on what properties (if any) that have had their values updated.
 Set<Annotatable> getAnnotatableParents()
          Always null.
static UpdateEvent getById(DbControl dc, int id)
          Get a UpdateEvent item when you know the id.
static ItemQuery<UpdateEvent> getQuery()
          Get a query that returns UpdateEvent items.
 Item getType()
          Get the type of item represented by the object.
 boolean isUsed()
          Check that: no item has been created from this UpdateEvent
 
Methods inherited from class org.proteios.core.BioMaterialEvent
addSource, getBioMaterial, getComment, getEntryDate, getEventDate, getEventType, getPreviousBioMaterialEvent, getProtocol, getQuery, getSourceBioMaterials, getSources, getUsedQuantityInMicroLiters, getUsedQuantityInMicroLiters, getUser, removeSource, setBioMaterial, setComment, setEntryDate, setEventDate, setPreviousBioMaterialEvent, setProtocol, setUsedQuantityInMicroLiters, setUser
 
Methods inherited from class org.proteios.core.BasicItem
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

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

See Also:
Item.PROTEIOS_UPDATEEVENT, getType()
Method Detail

getById

public static UpdateEvent getById(DbControl dc,
                                  int id)
                           throws ItemNotFoundException,
                                  BaseException
Get a UpdateEvent item when you know the id.

Parameters:
dc - The DbControl which will be used for database access.
id - The id of the item to load
Returns:
The UpdateEvent item
Throws:
ItemNotFoundException - If an item with the specified id is not found
BaseException - If there is another error

getQuery

public static ItemQuery<UpdateEvent> getQuery()
Get a query that returns UpdateEvent items.

Returns:
An ItemQuery object.

addUpdateComment

public void addUpdateComment(MeasuredBioMaterial measuredBioMaterial,
                             MeasuredBioMaterial oldMeasuredBioMaterial)
Adds an update event comment with info on what properties (if any) that have had their values updated. Convenience method intended to ensure that comments for update events are consistent for updates of different types of measured biomaterials. The method expects the measuredBioMaterial argument to have been updated, and the oldMeasuredBioMaterial argument to have property values before the update.

Parameters:
measuredBioMaterial - MeasuredBioMaterial Item after update.
oldMeasuredBioMaterial - MeasuredBioMaterial Item before update.

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
Overrides:
getType in class BioMaterialEvent<UpdateEventData>
Returns:
A value indicating the type of item

getAnnotatableParents

public Set<Annotatable> getAnnotatableParents()
                                       throws BaseException
Always null.

Throws:
BaseException

isUsed

public boolean isUsed()
               throws BaseException
Check that:

Overrides:
isUsed in class BioMaterialEvent<UpdateEventData>
Returns:
Always false
Throws:
BaseException

Last update: 2011-06-23