| java.lang.Object org.mmbase.util.QueryConvertor
QueryConvertor | public class QueryConvertor (Code) | | Class for the converion of a expression string to a SQL where clause.
The expressions string is expected to be in 'altavista' format.
This means that logical operators are identified by '+' (AND), '-' (NOT),
and '|' (OR).
Comparative operators are the same as those used in SCAN (i.e. '=E', '=N', etc)
A wildcarded strings (with '*' or '?' characters) are automatically converted
to a LIKE expression.
The resulting converted expression is preceded with the SQL 'WHERE ' keyword.
Note that if the expression to convert starts with "WHERE", it is not converted at all,
but returned as is.
author: Daniel Ockeloen author: Pierre van Rooden (javadocs) version: $Id: QueryConvertor.java,v 1.32 2007/02/25 18:12:16 nklasens Exp $ |
setConstraint | public static void setConstraint(BasicSearchQuery query, String where)(Code) | | Sets constraint for a
org.mmbase.storage.search.implementation.BasicSearchQueryBasicSearchQuery object.
The constraint may be specified as either one of these formats:
null or empty.
- A SQL search condition, starting with "WHERE " (ignoring case).
- A SQL search condition, of the form "WHERE(......)" (ignoring case).
- Altavista format.
If the query contains more than one step, the fields must be of the form
stepalias.field.
See
org.mmbase.storage.search.legacy.ConstraintParser for
more on how SQL search conditions are supported.
Note:
This method is provided to support different constraint formats for
backward compatibility (1, 3 and 4 above).
Do not call this method directly from new code, but rather use
org.mmbase.storage.search.legacy.ConstraintParser to parse
search constraints.
Parameters: query - The query. Parameters: where - The constraint. since: MMBase-1.7 |
|
|