|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.ebi.intenz.webapp.utilities.UnitOfWork
public class UnitOfWork
This is a simple UnitOfWork implementation to ease database updates.
Before a requested enzyme is loaded into the session a copy of this instance is made by theregister(uk.ac.ebi.intenz.webapp.dtos.EnzymeDTO)
method and kept in memory.
When the curator finished and pressed the 'submit' button, the enzyme instance modified
by the curator will be compared to the copy created in the beginning. Usually only data that changed will then be
stored (removed) in (from) the database (links are handled differently).
Field Summary | |
---|---|
static int |
UOW_ID
This class member is used to give registered objects a unique Unit of Work ID. |
Constructor Summary | |
---|---|
UnitOfWork()
Deprecated. |
|
UnitOfWork(EnzymeReactionMapper enzymeReactionMapper)
|
|
UnitOfWork(EnzymeReactionMapper enzymeReactionMapper,
EnzymeEntryMapper enzymeEntryMapper)
|
Method Summary | |
---|---|
void |
commit(EnzymeDTO enzymeUnderDevelopment,
Connection con)
Compares the given enzyme entry to the copy stored in register(uk.ac.ebi.intenz.webapp.dtos.EnzymeDTO) . |
protected void |
finalize()
|
EnzymeName |
getEnzymeNameObject(EnzymeNameDTO enzymeNameDTO)
Creates a EnzymeName object using a
EnzymeNameDTO object stored in the enzyme DTO. |
void |
register(EnzymeDTO enzymeUnderDevelopment)
Creates and stores a copy of the given EnzymeDTO instance. |
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent arg0)
|
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent arg0)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int UOW_ID
commit(uk.ac.ebi.intenz.webapp.dtos.EnzymeDTO, java.sql.Connection)
phase.
Constructor Detail |
---|
public UnitOfWork()
enzymesUnderDevelopment
.
public UnitOfWork(EnzymeReactionMapper enzymeReactionMapper)
public UnitOfWork(EnzymeReactionMapper enzymeReactionMapper, EnzymeEntryMapper enzymeEntryMapper)
Method Detail |
---|
protected void finalize() throws Throwable
finalize
in class Object
Throwable
public void register(EnzymeDTO enzymeUnderDevelopment)
EnzymeDTO
instance.
enzymeUnderDevelopment
- The current enzyme entry instance.public void commit(EnzymeDTO enzymeUnderDevelopment, Connection con) throws EcException, SQLException, DomainException, NumberFormatException, CommitException
register(uk.ac.ebi.intenz.webapp.dtos.EnzymeDTO)
.
Changes will be transferred to the database.
Data which is stored in lists will simply be reloaded at the moment.
If a new enzyme has been submitted this method will insert the entry into the database.
enzymeUnderDevelopment
- The enzyme the curator has worked on.con
- A database connection used to perform the changes in the database.
EcException
- if an invalid EC number has been used.
SQLException
- if a database error occurs.
DomainException
- if a domain error occurs.
CommitException
- if there is some data integrity threat
NumberFormatException
DeregisterException
- if an object does not exist in enzymesUnderDevelopment
(list of registered objects).public EnzymeName getEnzymeNameObject(EnzymeNameDTO enzymeNameDTO)
EnzymeName
object using a
EnzymeNameDTO
object stored in the enzyme DTO.
enzymeNameDTO
- The EnzymeNameDTO
used to create a
EnzymeName
object.
EnzymeName
.public void valueBound(javax.servlet.http.HttpSessionBindingEvent arg0)
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent arg0)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |