public class EnzymeCofactorMapper extends Object
close()
method, otherwise the underlying Rhea mapper objects will
keep their statements open.Constructor and Description |
---|
EnzymeCofactorMapper() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
deleteAll(Long enzymeId,
Connection con)
Deletes all cofactors related to one enzyme instance.
|
void |
deleteCompound(Long compoundId,
Connection con)
Deletes a cofactor from the COMPOUND_DATA table.
|
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.
|
uk.ac.ebi.rhea.domain.Compound |
findByChebiId(String chebiId,
Connection con)
Retrieves one cofactor from the IntEnz database by its ChEBI ID.
|
uk.ac.ebi.rhea.domain.Compound |
getCompound(Connection connection,
Long compoundId)
Retrieves a compound (cofactor) from the database.
|
void |
insert(Collection<Object> cofactors,
Long enzymeId,
uk.ac.ebi.intenz.domain.constants.Status status,
Connection con)
Stores the given list of cofactors into the database.
|
Long |
insertCompound(uk.ac.ebi.rhea.domain.Compound compound,
Connection con)
Inserts one compound (cofactor) into the COMPOUND_DATA table.
|
void |
reload(Collection<Object> cofactors,
Long enzymeId,
uk.ac.ebi.intenz.domain.constants.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.
|
public void close()
protected void finalize() throws Throwable
public Set<Object> find(Long enzymeId, Connection con) throws SQLException, uk.ac.ebi.rhea.mapper.MapperException
enzymeId
- Enzyme ID of entry.con
- The logical connection.Set
containing Cofactor
instances,
or OperatorSet
instances filled with Cofactor
objects,
or null
if nothing has been found.SQLException
- in case of a generic database problem.uk.ac.ebi.rhea.mapper.MapperException
- in case of problem retrieving the cofactors.public uk.ac.ebi.rhea.domain.Compound findByChebiId(String chebiId, Connection con) throws SQLException
chebiId
- the ChEBI ID of the cofactor.con
- a connection to IntEnz database.null
if it does not exist in IntEnz.SQLException
- in case of problem retrieving the cofactor.public Set<Object> exportSibCofactors(Long enzymeId, Connection con) throws SQLException, uk.ac.ebi.rhea.mapper.MapperException
enzymeId
- The enzyme ID used to retreive the related cofactors.con
- The database connection.ArrayList
of cofactors or null
if no cofactor could be found.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
.public Map<uk.ac.ebi.rhea.domain.Compound,Map<Long,String>> findAll(Connection con) throws SQLException, uk.ac.ebi.rhea.mapper.MapperException
con
- a database connectionSQLException
- 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
public void insert(Collection<Object> cofactors, Long enzymeId, uk.ac.ebi.intenz.domain.constants.Status status, Connection con) throws SQLException
cofactors
- The vector of cofactors.enzymeId
- The enzyme ID.status
- con
- ...SQLException
public Long insertCompound(uk.ac.ebi.rhea.domain.Compound compound, Connection con) throws SQLException
compound
- a compound.con
- a connection to the IntEnz database.SQLException
- in case of problem inserting the row.public void deleteCompound(Long compoundId, Connection con) throws SQLException
compoundId
- the internal ID of the compound.con
- a connection to the IntEnz database.SQLException
- in case of problem with the database.public void reload(Collection<Object> cofactors, Long enzymeId, uk.ac.ebi.intenz.domain.constants.Status status, Connection con) throws SQLException
cofactors
- The vector of cofactors.enzymeId
- The enzyme ID.status
- con
- ...SQLException
public void update(uk.ac.ebi.rhea.domain.Compound oldCf, uk.ac.ebi.rhea.domain.Compound newCf, Connection con) throws SQLException
oldCf
- the old cofactornewCf
- the new cofactorcon
- SQLException
public void deleteAll(Long enzymeId, Connection con) throws SQLException
enzymeId
- Enzyme ID of the enzyme instance.con
- ...SQLException
public uk.ac.ebi.rhea.domain.Compound getCompound(Connection connection, Long compoundId) throws SQLException
connection
- compoundId
- the internal compound ID.SQLException
Copyright © 2014 EMBL-EBI. All rights reserved.