|
SigPath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sigpath.database.EntityManager
public class EntityManager
EntityManager Provides database functionality regarding SigPathEntity objects.
| Constructor Summary | |
|---|---|
protected |
EntityManager(SPDBManager spdbManager)
Constructor initializes database manager. |
| Method Summary | |
|---|---|
boolean |
ACDBExists(String ac,
String db)
Determine if a given AC/DB pair exists in the database. |
void |
add(SigPathEntity spe)
Adds a SigPathEntity object to the database. |
void |
addIndexed(SigPathEntity spe)
Adds a SigPathEntity object to the database. |
void |
addIndexed(SigPathEntity spe,
FTSManagerMeasurements measure)
Adds a SigPathEntity object to the database. |
void |
close()
This method is used to free any resources and closes any database connections used by the manager |
void |
delete(Object obj)
|
void |
deleteAll(Collection c)
|
Collection |
entityBackwardReferences(SigPathEntity spe,
Query query)
Query for a set of entities that contain the given SigPathEntity spe in their forward references list. |
Collection |
filterOrganisms(Collection chems,
String orgName,
boolean exact)
Filters a collection of chemicals according to organism. |
Collection |
getAll(String classname)
Returns a Collection of all SigPathEntity objects in the database. |
Iterator |
getAllExportable(String classname)
Get an iterator on all exportable entities. |
Collection |
getAllIndexed(String classname)
|
Iterator |
getAllIndexedIterator(String classname)
|
Iterator |
getAllIterator(String classname)
Returns an Iterator of all SigPathEntity objects in the database. |
Iterator |
getAllIterator(String classname,
String indexname,
String filter,
boolean reset,
int startIndex)
Returns an Iterator of all SigPathEntity objects in the database. |
Collection |
getAllNotIndexed(String classname)
|
Iterator |
getAllNotIndexedIterator(String classname)
|
Iterator |
getAllOrganisms()
Returns an iterator over each Organism instance defined in the database. |
Set |
getModifiedList()
Get List of modified entities. |
int |
getNumEntities(String classname)
Gets total Number of Entities of a given classname. |
int |
getSizeOfLlookupIntersection(String booleanQuery,
String classname,
String oraganism)
|
String |
getSpidFromAc(String ac,
String db)
Obtains the spid of an entity. |
static Integer |
getSpidIndex(String spid)
Returns the index of this spid or bid. |
boolean |
isBioPolymer(String spid)
Checks to see if a SigPathEntity is an instance of BioPolymer. |
boolean |
isChemical(String spid)
Checks to see if a SigPathEntity is an instance of Chemical. |
boolean |
isComplex(String spid)
Checks to see if a SigPathEntity is an instance of Complex. |
boolean |
isEnzymaticReaction(String spid)
This method determines if the specified reaction is enzymatic. |
boolean |
isEnzyme(String spid)
|
boolean |
isModifiedChemical(String spid)
Checks to see if a SigPathEntity is a modified chemical. |
Collection |
lookupByAC(String ac,
String orgName)
Lookup a sigpath entity by accession code. |
SigPathEntity |
lookupByAC(String ac,
String database,
String orgName)
Searches SigPathEntity objects in the database with names matching the given accession code and database. |
Collection |
lookupByACDB(String ac,
String database)
Searches SigPathEntity objects in the database with names matching the given accession code and database. |
Collection |
lookupByACDBOrg(String acdb,
String organismName)
Returns a colection of entities that match accession code in database and organism name. |
Collection |
lookupByExactName(String name,
String classname)
Searches SigPathEntity objects in the database with names matching exactly the given name. |
Collection |
lookupByName(String name,
Class clazz)
|
Collection |
lookupByName(String name,
String classname)
Searches SigPathEntity objects in the database with names matching the given name. |
SigPathEntity |
lookupBySpid(String spid)
Searches SigPathEntity objects in the database with a SPID matching the given SPID. |
Collection |
lookupBySpids(Collection spids,
Query query)
Queries for a set of entities that have certain spids. |
Iterator |
lookupConcentrationsBySpid(String spid)
|
Collection |
lookupIntersection(String booleanQuery,
String classname)
|
Collection |
lookupIntersection(String booleanQuery,
String classname,
int startIndex,
int recordsNumber)
Full text lookup of boolean query. |
Collection |
lookupIntersection(String booleanQuery,
String classname,
int startIndex,
int recordsNumber,
FTSManagerMeasurements measure)
|
Collection |
lookupIntersectionByOrganism(String className,
String query,
String orgName,
boolean exact)
|
Collection |
lookupIntersectionByOrganism(String className,
String keywords,
String orgName,
int startIndex,
int recordsNumber)
|
Kinetic |
lookupKineticByName(String name)
Queries for kinetics using a name. |
Collection |
lookupOrganism(String subString)
Lookup an organism by subString. |
Organism |
lookupOrganismBySpecies(String species)
Lookup an organism by species. |
Collection |
lookupOrganismsBySpecies(String species)
Lookup a organism by species. |
Object |
lookupSpidRangeByType(int type)
Searches for SpidRange of a specific type. |
SigPathEntity |
newEntity(String eType,
String name,
String[] aliases,
String[] ac,
String[] db,
String desc)
Convenience method which returns a new SigPathEntity of type eType. |
SigPathEntity |
newEntityWithSPID(String eType,
String spid,
String name,
String[] aliases,
String[] ac,
String[] db,
String desc)
|
boolean |
organismExists(String orgName)
Checks to see if an Organism exists. |
void |
resolve(Object obj)
|
void |
resolveAll(Collection c)
|
void |
setSPEData(SigPathEntity spe,
String name,
String[] aliases,
String[] ac,
String[] db,
String desc)
Sets the SigPath Base Data. |
boolean |
uniqueACDB(String ac,
String db)
Determine if a given AC/DB pair is unique in the database. |
void |
updateModifiedList(SigPathEntity spe)
Updates the Modified Entity List, so that we can easily keep track of all changes and then export any changes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected EntityManager(SPDBManager spdbManager)
spdbManager - database manager| Method Detail |
|---|
public void updateModifiedList(SigPathEntity spe)
throws SigPathDatabaseException
SigPathDatabaseException
public Set getModifiedList()
throws SigPathDatabaseException
SigPathDatabaseException
public SigPathEntity newEntity(String eType,
String name,
String[] aliases,
String[] ac,
String[] db,
String desc)
eType - String type of SigPathEntity to create, currently
provides functionality for Protein and SmallMolecule objects Set eType
to "protein" to create a Protein object
Set eType to "smallmolecule" to create a SmallMolecule objectname - String name of the SigPathEntityaliases - String[] aliases of the SigPathEntityac - String[] accession code of the SigPathEntitydb - String[] database pair to accession code of SigPathEntitydesc - String description of the SigPathEntity
SigPathEntity
public SigPathEntity newEntityWithSPID(String eType,
String spid,
String name,
String[] aliases,
String[] ac,
String[] db,
String desc)
public void setSPEData(SigPathEntity spe,
String name,
String[] aliases,
String[] ac,
String[] db,
String desc)
public Collection getAll(String classname)
throws SigPathDatabaseException
classname - String name of class found in SigPathConstants to be
used in finding class extent in the current database
java.util.Collection of SigPathEntity objects
SigPathDatabaseException - if there is an error with the
database or the querySigPathEntity,
SigPathConstants
public Iterator getAllExportable(String classname)
throws SigPathDatabaseException
classname -
SigPathDatabaseException
public Iterator getAllIterator(String classname)
throws SigPathDatabaseException
classname - String name of class found in SigPathConstants to be
used in finding class extent in the current database.
The iterators returns entitites ordered by Spid if an
index exists on spid for the classname.
java.util.Iterator of SigPathEntity objects if one
is found, otherwise null
SigPathDatabaseException - if there is an error with the
database or the querySigPathEntity,
SigPathConstants,
SigPathConstants.INDEX_DOES_NOT_EXIST,
SigPathConstants.getSpidIndexName(java.lang.String)
public Iterator getAllIterator(String classname,
String indexname,
String filter,
boolean reset,
int startIndex)
throws SigPathDatabaseException
classname - String name of class found in SigPathConstants to be
used in finding class extent in the current database The iterators
returns entitites ordered by Spid if an index exists
on spid for the classname.indexname - String name of index to usefilter - predicate to filter the extent byreset - boolean value for resetting the extent or notstartIndex - int value of startIndex, set to -1 if no start index
is to be used
java.util.Iterator of SigPathEntity objects if one
is found, otherwise null
SigPathDatabaseException - if there is an error with the
database or the querySigPathEntity,
SigPathConstants,
SigPathConstants.INDEX_DOES_NOT_EXIST,
SigPathConstants.getSpidIndexName(java.lang.String)
public Iterator getAllNotIndexedIterator(String classname)
throws SigPathDatabaseException
SigPathDatabaseException
public Iterator getAllIndexedIterator(String classname)
throws SigPathDatabaseException
SigPathDatabaseException
public Collection getAllNotIndexed(String classname)
throws SigPathDatabaseException
SigPathDatabaseException
public Collection getAllIndexed(String classname)
throws SigPathDatabaseException
SigPathDatabaseException
public Collection lookupIntersection(String booleanQuery,
String classname,
int startIndex,
int recordsNumber)
throws SigPathDatabaseException
booleanQuery - The query, eg. "receptor kinase" succession of
individual keywords separated by the delimiters recognized by
FullTextSearchManager.classname - The class of the results to be returned. It is
guaranteed that only subclasses of this class will be returned.
SigPathDatabaseException
public Collection lookupIntersection(String booleanQuery,
String classname,
int startIndex,
int recordsNumber,
FTSManagerMeasurements measure)
throws SigPathDatabaseException
SigPathDatabaseException
public Collection lookupIntersection(String booleanQuery,
String classname)
throws SigPathDatabaseException
SigPathDatabaseException
public int getSizeOfLlookupIntersection(String booleanQuery,
String classname,
String oraganism)
throws SigPathDatabaseException
SigPathDatabaseException
public SigPathEntity lookupByAC(String ac,
String database,
String orgName)
throws SigPathDatabaseException
ac - accession code search Stringdatabase - database search String
org.sigpath.datamodel.SigPathEntity,
null if no matches are found
SigPathDatabaseException - if there is an error with the
database or the querySigPathEntity,
SigPathConstants
public Collection lookupByAC(String ac,
String orgName)
throws SigPathDatabaseException
ac - accession code in an external database.
Collection of entities that match the accession
code, or null.
SigPathDatabaseException - if there is an error with the
database or the querySigPathEntity
public Iterator lookupConcentrationsBySpid(String spid)
throws SigPathDatabaseException
SigPathDatabaseException
public Iterator getAllOrganisms()
throws SigPathDatabaseException
SigPathDatabaseException
public Collection lookupOrganism(String subString)
throws SigPathDatabaseException
subString - what to look for in the organism species and
commonName fields.
SigPathDatabaseException
public Organism lookupOrganismBySpecies(String species)
throws SigPathDatabaseException
species - species of the organism to be returned.
SigPathDatabaseException
public Collection lookupOrganismsBySpecies(String species)
throws SigPathDatabaseException
species - species of the organism to be returned.
SigPathDatabaseException
public Collection lookupIntersectionByOrganism(String className,
String keywords,
String orgName,
int startIndex,
int recordsNumber)
throws SigPathDatabaseException
SigPathDatabaseException
public Collection lookupIntersectionByOrganism(String className,
String query,
String orgName,
boolean exact)
throws SigPathDatabaseException
SigPathDatabaseException
public Collection filterOrganisms(Collection chems,
String orgName,
boolean exact)
chems - The set of chemicals to filterorgName - The keyword to match in the name of the organism
of each chemicalexact - true if the match must be exact or false if matching a
substring of the chemical organism is good enough.
public boolean organismExists(String orgName)
throws SigPathDatabaseException
orgName - Species or Common Name of organism (exact matching)
SigPathDatabaseException
public Collection lookupByACDBOrg(String acdb,
String organismName)
throws SigPathDatabaseException
acdb - Accession code and database name, in the format db:acorganismName - orgnism name.
SigPathDatabaseException
public Collection lookupByACDB(String ac,
String database)
throws SigPathDatabaseException
ac - accession code search Stringdatabase - database search String
Collection of entities that match the accession
code, or null.
SigPathDatabaseException - if there is an error with the
database or the query
public boolean ACDBExists(String ac,
String db)
throws SigPathDatabaseException
ac - Accession code in an external database.db - name of accession code database that the accession
code references
SigPathDatabaseException
public boolean uniqueACDB(String ac,
String db)
throws SigPathDatabaseException
ac - Accession code in an external database.db - name Database that the accession code references.
SigPathDatabaseException
public Object lookupSpidRangeByType(int type)
throws SigPathDatabaseException
type - as integer
SigPathDatabaseException
public Collection lookupByName(String name,
String classname)
throws SigPathDatabaseException
name - Name of SigPathEntity to search for.classname - String name of class found in SigPathConstants to be
used in finding class extent in the current database
java.util.Collection of SigPathEntity objects
empty java.util.Collection if no matches are found
SigPathDatabaseException - if there is an error with the
database or the querySigPathEntity,
SigPathConstants
public Collection lookupByName(String name,
Class clazz)
throws SigPathDatabaseException
SigPathDatabaseException
public Collection lookupByExactName(String name,
String classname)
throws SigPathDatabaseException
name - Name of SigPathEntity to search for.classname - String name of class found in SigPathConstants to be
used in finding class extent in the current database
java.util.Collection of SigPathEntity objects
empty java.util.Collection if no matches are found
SigPathDatabaseException - if there is an error with the
database or the querySigPathEntity,
SigPathConstants
public int getNumEntities(String classname)
throws SigPathDatabaseException
SigPathDatabaseException
public SigPathEntity lookupBySpid(String spid)
throws SigPathDatabaseException
spid - SPID of SigPathEntity to search for.
SigPathDatabaseException - if there is an error with the
database or the query
public void add(SigPathEntity spe)
throws SigPathDatabaseException
spe - SigPathEntity that will be added to database
SigPathDatabaseException - if there is an error with the databaseSigPathEntity
public void addIndexed(SigPathEntity spe)
throws SigPathDatabaseException
spe - SigPathEntity that will be added to database
SigPathDatabaseException - if there is an error with the databaseSigPathEntity
public void addIndexed(SigPathEntity spe,
FTSManagerMeasurements measure)
throws SigPathDatabaseException
spe - SigPathEntity that will be added to databasemeasure - FTSManagerMeasurements to measure the time used
to fulltext index the element
SigPathDatabaseException - if there is an error with the databaseSigPathEntitypublic void delete(Object obj)
public void deleteAll(Collection c)
public void resolve(Object obj)
public void resolveAll(Collection c)
public boolean isBioPolymer(String spid)
throws SigPathDatabaseException
spid - spid of SigPathEntity
SigPathDatabaseExceptionpublic void close()
close in interface SigPathManager
public String getSpidFromAc(String ac,
String db)
throws SigPathDatabaseException
ac - Accession code of this entity.db - Database
SigPathDatabaseException
public boolean isEnzymaticReaction(String spid)
throws SigPathDatabaseException
spid - SPID of the reaction to check
SigPathDatabaseException
public boolean isModifiedChemical(String spid)
throws SigPathDatabaseException
spid - spid of SigPathEntity
SigPathDatabaseException
public boolean isComplex(String spid)
throws SigPathDatabaseException
spid - spid of SigPathEntity
SigPathDatabaseException - When the entity cannot be found.
public boolean isChemical(String spid)
throws SigPathDatabaseException
spid - spid of SigPathEntity
SigPathDatabaseException
public boolean isEnzyme(String spid)
throws SigPathDatabaseException
SigPathDatabaseException
public Collection lookupBySpids(Collection spids,
Query query)
spids - A collection of spids (String type)query - A new query obtained with SPDBManager.newQuery. Use you
query instance to free resources associated with the query.
public Collection entityBackwardReferences(SigPathEntity spe,
Query query)
public static Integer getSpidIndex(String spid)
spid - Spid or bid, such as sp23 or bid45.
public Kinetic lookupKineticByName(String name)
throws SigPathDatabaseException
SigPathDatabaseException
|
SigPath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||