public class BasicQueryHandler extends Object implements SearchQueryHandler
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.
FEATURE_MAX_NUMBER, FEATURE_OFFSET, FEATURE_REGEXP, SUPPORT_NONE, SUPPORT_NORMAL, SUPPORT_OPTIMAL, SUPPORT_WEAK| Constructor and Description |
|---|
BasicQueryHandler(SqlHandler sqlHandler)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
createSqlString(SearchQuery query)
Makes a String of a query, taking into consideration if the database supports offset and
maxnumber features.
|
List<MMObjectNode> |
getNodes(SearchQuery query,
MMObjectBuilder builder)
Processes a search query, returns the result as a list of nodes.
|
int |
getSupportLevel(Constraint constraint,
SearchQuery query)
Gets the level at which a constraint is supported for a query
by this handler.
|
int |
getSupportLevel(int feature,
SearchQuery query)
Gets the level at which a feature is supported for a query
by this handler.
|
public BasicQueryHandler(SqlHandler sqlHandler)
sqlHandler - The handler use to create SQL string representations
of search queries.public List<MMObjectNode> getNodes(SearchQuery query, MMObjectBuilder builder) throws SearchQueryException
SearchQueryHandler<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
getNodes in interface SearchQueryHandlerquery - The search query.builder - The builder for the result nodes. Specify a
ResultBuilder
to get resultnodes.
ClusterBuilder
to get clusternodes.SearchQueryExceptionResultNode,
ClusterNodepublic String createSqlString(SearchQuery query) throws SearchQueryException
createSqlString in interface SearchQueryHandlerquery - the query to convert to sqlSearchQueryException - when error occurs while making the stringpublic int getSupportLevel(int feature,
SearchQuery query)
throws SearchQueryException
SearchQueryHandlergetSupportLevel in interface SearchQueryHandlerSearchQueryExceptionpublic int getSupportLevel(Constraint constraint, SearchQuery query) throws SearchQueryException
SearchQueryHandlergetSupportLevel in interface SearchQueryHandlerSearchQueryExceptionMMBase 1.9-SNAPSHOT - ${javadoctimestamp}