net.sourceforge.fluxion.datasource.query
Interface Query<T>

All Known Implementing Classes:
BiomartQuery, MySQLQuery, ODBCQuery, PostgresqlQuery, SQLQuery

public interface Query<T>

A query against the beanmodel for a single bean type. When executed, the query will return the set of beans corresponding to the query.

Version:
0.2
Author:
Tony Burdett

Method Summary
 java.lang.String execute()
          Execute this query.
 boolean hasMoreResults()
          True if there are more results, false otherwise
 T nextResult()
          Returns the next result in the sequence
 

Method Detail

execute

java.lang.String execute()
                         throws QueryExecutionException
Execute this query. Queries should know how to acquire a connection to the datasource. Once executed, results can be pulled from this query using nextResult(), which will return the next bean instance. This method returns a String that describes the query that has been executed. This is used for logging purposes, and will usually look something like "LANG: SQL; STATEMENT: SELECT * FROM foo WHERE bar"

Returns:
a string that describes the query
Throws:
QueryExecutionException - if the query failed to execute

hasMoreResults

boolean hasMoreResults()
                       throws QueryExecutionException
True if there are more results, false otherwise

Returns:
true if there are more results, false otherwise
Throws:
QueryExecutionException - if there is some problem with retrieving the results of the query

nextResult

T nextResult()
             throws QueryExecutionException
Returns the next result in the sequence

Returns:
the next result
Throws:
QueryExecutionException - if there is a problem retrieving the next result


Copyright © 2010. All Rights Reserved.