org.intermine.bio.chado
Class ChadoCVFactory

java.lang.Object
  extended by org.intermine.bio.chado.ChadoCVFactory

public class ChadoCVFactory
extends java.lang.Object

A factory for ChadoCV objects.


Constructor Summary
ChadoCVFactory(java.sql.Connection connection)
          Create a new ChadoCVFactory.
 
Method Summary
 ChadoCV getChadoCV(java.lang.String cvName)
          Get a new ChadoCV containing only cv terms from the cv with the given name.
protected  java.sql.ResultSet getCVTermRelationshipResultSet(java.sql.Connection connection, java.lang.String cvName)
          Return the rows from the cvterm_relationship table that relate cvterms from the cv with the given name.
protected  java.sql.ResultSet getCVTermResultSet(java.sql.Connection connection, java.lang.String cvName)
          Return the rows from the cvterm table that are from the cv with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChadoCVFactory

public ChadoCVFactory(java.sql.Connection connection)
Create a new ChadoCVFactory.

Parameters:
connection - the connection to use for querying cvterms.
Method Detail

getChadoCV

public ChadoCV getChadoCV(java.lang.String cvName)
                   throws java.sql.SQLException
Get a new ChadoCV containing only cv terms from the cv with the given name.

Parameters:
cvName - the name of the cv = cv.name in chado
Returns:
the new ChadoCV object
Throws:
java.sql.SQLException - if there is problem while querying

getCVTermRelationshipResultSet

protected java.sql.ResultSet getCVTermRelationshipResultSet(java.sql.Connection connection,
                                                            java.lang.String cvName)
                                                     throws java.sql.SQLException
Return the rows from the cvterm_relationship table that relate cvterms from the cv with the given name. This is a protected method so that it can be overriden for testing

Parameters:
connection - the db connection
cvName - the value of the name field to use when finding the cv
Returns:
the SQL result set
Throws:
java.sql.SQLException - if a database problem occurs

getCVTermResultSet

protected java.sql.ResultSet getCVTermResultSet(java.sql.Connection connection,
                                                java.lang.String cvName)
                                         throws java.sql.SQLException
Return the rows from the cvterm table that are from the cv with the given name. This is a protected method so that it can be overriden for testing

Parameters:
connection - the db connection
cvName - the value of the name field to use when finding the cv
Returns:
the SQL result set
Throws:
java.sql.SQLException - if a database problem occurs