Class XPathToSQL2Converter
- java.lang.Object
-
- org.apache.jackrabbit.oak.query.xpath.XPathToSQL2Converter
-
public class XPathToSQL2Converter extends Object
This class can can convert a XPATH query to a SQL2 query.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
NODETYPE_OPTIMIZATION
Optimize queries of the form "from [nt:base] where [jcr:primaryType] = 'x'" to "from [x] where [jcr:primaryType] = 'x'".static boolean
NODETYPE_UNION
Convert queries of the form "where [jcr:primaryType] = 'x' or [jcr:primaryType] = 'y'" to "select ...
-
Constructor Summary
Constructors Constructor Description XPathToSQL2Converter()
XPathToSQL2Converter(QueryEngineSettings settings)
-
-
-
Field Detail
-
NODETYPE_OPTIMIZATION
public static final boolean NODETYPE_OPTIMIZATION
Optimize queries of the form "from [nt:base] where [jcr:primaryType] = 'x'" to "from [x] where [jcr:primaryType] = 'x'". Enabled by default.
-
NODETYPE_UNION
public static final boolean NODETYPE_UNION
Convert queries of the form "where [jcr:primaryType] = 'x' or [jcr:primaryType] = 'y'" to "select ... where [jcr:primaryType] = 'x' union select ... where [jcr:primaryType] = 'y'". If disabled, only one query with "where [jcr:primaryType] in ('x', 'y') is used. Enabled by default.
-
-
Constructor Detail
-
XPathToSQL2Converter
public XPathToSQL2Converter()
-
XPathToSQL2Converter
public XPathToSQL2Converter(QueryEngineSettings settings)
-
-
Method Detail
-
convert
public String convert(String query) throws ParseException
Convert the query to SQL2.- Parameters:
query
- the query string- Returns:
- the SQL2 query
- Throws:
ParseException
- if parsing fails
-
-