uk.ac.ebi.intenz.mapper
Class EnzymeCofactorMapper

java.lang.Object
  extended by uk.ac.ebi.intenz.mapper.EnzymeCofactorMapper

public class EnzymeCofactorMapper
extends Object

Maps reaction information to the corresponding database tables.
IMPORTANT: after using instances of this class, call the close() method, otherwise the underlying Rhea mapper objects will keep their statements open.

Version:
$Revision: 1.10 $ $Date: 2009/05/26 14:59:09 $
Author:
Michael Darsow

Field Summary
protected  uk.ac.ebi.rhea.mapper.db.RheaCompoundDbReader rheaCompoundReader
           
 
Constructor Summary
EnzymeCofactorMapper()
           
 
Method Summary
 void close()
          Closes the underlying RheaCompoundDbReader.
 void deleteAll(Long enzymeId, Connection con)
          Deletes all cofactors related to one enzyme instance.
 Set<Object> exportSibCofactors(Long enzymeId, Connection con)
          Exports all cofactors which are displayed in the ENZYME view.
protected  void finalize()
           
 Set<Object> find(Long enzymeId, Connection con)
          Tries to find cofactor information about an enzyme.
 Map<uk.ac.ebi.rhea.domain.Compound,Map<Long,String>> findAll(Connection con)
          Retrieves a list of compounds acting as cofactors in the database, along with the identifiers for the enzymes they appear in.
 void insert(Collection<Object> cofactors, Long enzymeId, Status status, Connection con)
          Stores the given list of cofactors into the database.
 void reload(Collection<Object> cofactors, Long enzymeId, Status status, Connection con)
          Reloads the given list of cofactors into the database.
 void update(uk.ac.ebi.rhea.domain.Compound oldCf, uk.ac.ebi.rhea.domain.Compound newCf, Connection con)
          Updates the ChEBI mapping of a cofactor, and the name if needed too.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rheaCompoundReader

protected uk.ac.ebi.rhea.mapper.db.RheaCompoundDbReader rheaCompoundReader
Constructor Detail

EnzymeCofactorMapper

public EnzymeCofactorMapper()
Method Detail

close

public void close()
Closes the underlying RheaCompoundDbReader.


finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

find

public Set<Object> find(Long enzymeId,
                        Connection con)
                 throws SQLException,
                        uk.ac.ebi.rhea.mapper.MapperException
Tries to find cofactor information about an enzyme.

Parameters:
enzymeId - Enzyme ID of entry.
con - The logical connection.
Returns:
a Set containing Cofactor instances, or OperatorSet instances filled with Cofactor objects, or null if nothing has been found.
Throws:
SQLException - in case of a generic database problem.
uk.ac.ebi.rhea.mapper.MapperException - in case of problem retrieving the cofactors.

exportSibCofactors

public Set<Object> exportSibCofactors(Long enzymeId,
                                      Connection con)
                               throws SQLException,
                                      uk.ac.ebi.rhea.mapper.MapperException
Exports all cofactors which are displayed in the ENZYME view. Affected table rows will be locked.

Parameters:
enzymeId - The enzyme ID used to retreive the related cofactors.
con - The database connection.
Returns:
an ArrayList of cofactors or null if no cofactor could be found.
Throws:
SQLException - in case of a generic database problem.
uk.ac.ebi.rhea.mapper.MapperException - in case of problem retrieving the cofactors.
NullPointerException - if either of the parameters is null.

findAll

public Map<uk.ac.ebi.rhea.domain.Compound,Map<Long,String>> findAll(Connection con)
                                                             throws SQLException,
                                                                    uk.ac.ebi.rhea.mapper.MapperException
Retrieves a list of compounds acting as cofactors in the database, along with the identifiers for the enzymes they appear in.

Parameters:
con - a database connection
Returns:
a map of compounds (cofactors) to pairs enzyme ID/EC number.
Throws:
SQLException - in case of a generic database problem.
uk.ac.ebi.rhea.mapper.MapperException - in case of problem retrieving compounds.
uk.ac.ebi.rhea.mapper.MapperException

insert

public void insert(Collection<Object> cofactors,
                   Long enzymeId,
                   Status status,
                   Connection con)
            throws SQLException
Stores the given list of cofactors into the database.

Parameters:
cofactors - The vector of cofactors.
enzymeId - The enzyme ID.
status -
con - ...
Throws:
SQLException

reload

public void reload(Collection<Object> cofactors,
                   Long enzymeId,
                   Status status,
                   Connection con)
            throws SQLException
Reloads the given list of cofactors into the database.

Parameters:
cofactors - The vector of cofactors.
enzymeId - The enzyme ID.
status -
con - ...
Throws:
SQLException

update

public void update(uk.ac.ebi.rhea.domain.Compound oldCf,
                   uk.ac.ebi.rhea.domain.Compound newCf,
                   Connection con)
            throws SQLException
Updates the ChEBI mapping of a cofactor, and the name if needed too.

Parameters:
oldCf - the old cofactor
newCf - the new cofactor
con -
Throws:
SQLException

deleteAll

public void deleteAll(Long enzymeId,
                      Connection con)
               throws SQLException
Deletes all cofactors related to one enzyme instance.

Parameters:
enzymeId - Enzyme ID of the enzyme instance.
con - ...
Throws:
SQLException


Copyright © 2013 EMBL-EBI. All Rights Reserved.