org.intermine.sql.precompute
Class EncloseSubqueryBestQuery

java.lang.Object
  extended by org.intermine.sql.precompute.BestQuery
      extended by org.intermine.sql.precompute.EncloseSubqueryBestQuery

public class EncloseSubqueryBestQuery
extends BestQuery

This object is a BestQuery tracker that encloses all added queries into a surrounding query as a subquery, and passes them onto another BestQuery tracker.


Constructor Summary
EncloseSubqueryBestQuery(BestQuery bestQuery, java.lang.String beginning, java.lang.String end)
          Constructor.
 
Method Summary
 void add(Query q)
          Allows a Query to be added to this tracker.
 void add(java.lang.String q)
          Allows a Query to be added to this tracker.
 Query getBestQuery()
          Gets the best Query found so far
 java.lang.String getBestQueryString()
          Gets the best query String found so far
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncloseSubqueryBestQuery

public EncloseSubqueryBestQuery(BestQuery bestQuery,
                                java.lang.String beginning,
                                java.lang.String end)
Constructor.

Parameters:
bestQuery - another BestQuery object to delegate to
beginning - the String to add to the beginning of all queries
end - the String to add to the end of all queries
Method Detail

add

public void add(Query q)
         throws BestQueryException,
                java.sql.SQLException
Allows a Query to be added to this tracker.

Specified by:
add in class BestQuery
Parameters:
q - a Query to be added to the tracker
Throws:
BestQueryException - when adding should stop
java.sql.SQLException - if error occurs in the underlying database

add

public void add(java.lang.String q)
         throws BestQueryException,
                java.sql.SQLException
Allows a Query to be added to this tracker.

Specified by:
add in class BestQuery
Parameters:
q - a query String to be added to the tracker
Throws:
BestQueryException - when adding should stop
java.sql.SQLException - if error occurs in the underlying database

getBestQuery

public Query getBestQuery()
                   throws java.sql.SQLException
Gets the best Query found so far

Specified by:
getBestQuery in class BestQuery
Returns:
the best Query, or null if no Queries added to this object
Throws:
java.sql.SQLException - if error occurs in the underlying database

getBestQueryString

public java.lang.String getBestQueryString()
                                    throws java.sql.SQLException
Gets the best query String found so far

Specified by:
getBestQueryString in class BestQuery
Returns:
the best Query, or null if no Queries added to this object
Throws:
java.sql.SQLException - if error occurs in the underlying database