org.mmbase.storage.search.implementation.database
Class BasicQueryHandler
java.lang.Object
org.mmbase.storage.search.implementation.database.BasicQueryHandler
- All Implemented Interfaces:
- CoreSearchQueryHandler, SearchQueryHandler
public class BasicQueryHandler
- extends Object
- implements CoreSearchQueryHandler
Basic implementation using a database.
Uses a SqlHandler
to create SQL string representations of search queries.
In order to execute search queries, these are represented as SQL strings
by the handler, and in this form executed on the database.
- Since:
- MMBase-1.7
- Version:
- $Id: BasicQueryHandler.java 45472 2011-02-27 15:16:53Z michiel $
- Author:
- Rob van Maris
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicQueryHandler
public BasicQueryHandler(SqlHandler sqlHandler)
- Default constructor.
- Parameters:
sqlHandler - The handler use to create SQL string representations
of search queries.
getNodes
public List<MMObjectNode> getNodes(SearchQuery query,
MMObjectBuilder builder)
throws SearchQueryException
- Description copied from interface:
CoreSearchQueryHandler
- Processes a search query, returns the result as a list of nodes.
Depending on the specified builder, the results will be:
- Resultnodes, with fields named according to the field aliases
specified by the query.
- Clusternodes, with fields named
<step alias>.<field name>, where
the step alias is required to be of the form
<step tablename><x>, and
<x> is either empty or a single digit. Examples:
images.number, images0.number,
images1.number
- Real nodes, where all fields are required to be included in
the query.
- Specified by:
getNodes in interface CoreSearchQueryHandler
- Parameters:
query - The search query.builder - The builder for the result nodes. Specify a
ResultBuilder
to get resultnodes.
ClusterBuilder
to get clusternodes.
- Returns:
- The resulting nodes.
- Throws:
SearchQueryException- See Also:
ResultNode,
ClusterNode
createSqlString
public String createSqlString(SearchQuery query)
throws SearchQueryException
- Makes a String of a query, taking into consideration if the database supports offset and
maxnumber features. The resulting String is an SQL query which can be fed to the database.
- Specified by:
createSqlString in interface SearchQueryHandler
- Parameters:
query - the query to convert to sql
- Returns:
- the sql string
- Throws:
SearchQueryException - when error occurs while making the string
getSupportLevel
public int getSupportLevel(int feature,
SearchQuery query)
throws SearchQueryException
- Specified by:
getSupportLevel in interface SearchQueryHandler
- Throws:
SearchQueryException
getSupportLevel
public int getSupportLevel(Constraint constraint,
SearchQuery query)
throws SearchQueryException
- Specified by:
getSupportLevel in interface SearchQueryHandler
- Throws:
SearchQueryException
MMBase2 Core 2.0-SNAPSHOT - 2013-05-29T22:08