Keel 2.1RC2

org.keel.services.query
Interface Query

All Known Implementing Classes:
DefaultQuery

public interface Query

This component provides a general-purpose interface to Queries against persistent stores. Each implementation of the persistent service can provide it's own implementation of Query - for example, the default implementation might query databases via JDBC. The exact structure of the query is based on configuration. Each query can be refined at runtime by specifying variable criteria in one of two ways: By named criteria (using the setCriteria(String, Object) method, or by passing the Query a list of ObjectKey objects, which may be the result of the operation of a Criteria component. In either case, the Query returns a set of Maps in the specified order.

Author:
Michael Nash, Eliot Clingman

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 java.util.List getQueryResult(ObjectKey objectKey)
          This is merely a convenience method, if you want to analyze only one object This output could contain one or more beans, rowsets, flat files, etc.
 java.util.List getQueryResults()
          This is a quick query that does not depend on running the Criteria service before the query service.
 java.util.List getQueryResults(java.util.SortedSet objectKeys)
          Using the output set of a Criteria implementation, get a set of results for those objects.
 void setCriteria(java.lang.String criteriaCode, java.lang.Object criteriaValue)
          Provide named "criteria" to control the operation of the query
 

Field Detail

ROLE

public static final java.lang.String ROLE
See Also:
Constant Field Values
Method Detail

setCriteria

public void setCriteria(java.lang.String criteriaCode,
                        java.lang.Object criteriaValue)
                 throws QueryException
Provide named "criteria" to control the operation of the query

Parameters:
criteriaCode - Name of the criteria being specified
criteriaValue - Value of the criteria
Throws:
QueryException - If there is no such criteria, or the value is not allowed

getQueryResults

public java.util.List getQueryResults(java.util.SortedSet objectKeys)
                               throws QueryException
Using the output set of a Criteria implementation, get a set of results for those objects. This output could contain set of beans, table rows, flat files, any type of relevant info about the objects. Note The output List may, but is not neccasarily, in same order as the input set. The ordering is of course different if each object key results in multiple outputs.

Returns:
A List containing Maps, one for each query result. Each map is a name / value mapping for each result "row"
Throws:
QueryException

getQueryResults

public java.util.List getQueryResults()
                               throws QueryException
This is a quick query that does not depend on running the Criteria service before the query service. There will therefore be no object keys available to pass in to the query service. The query service is therefore at the mercy of criteria parameters (which has nothing to do with Criteria service by the way.) Using the parameters, get a List of results. This output could contain List of beans, table rows, flat files, any type of relevant info.

Returns:
A List containing Maps, one for each query result. Each map is a name / value mapping for each result "row"
Throws:
QueryException

getQueryResult

public java.util.List getQueryResult(ObjectKey objectKey)
                              throws QueryException
This is merely a convenience method, if you want to analyze only one object This output could contain one or more beans, rowsets, flat files, etc.

Returns:
A List containing Maps, one for each query result. Each map is a name / value mapping for each result "row"
Throws:
QueryException

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.