Class XPathToSQL2Converter
java.lang.Object
org.apache.jackrabbit.oak.query.xpath.XPathToSQL2Converter
This class can can convert a XPATH query to a SQL2 query.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
Optimize queries of the form "from [nt:base] where [jcr:primaryType] = 'x'" to "from [x] where [jcr:primaryType] = 'x'".static final boolean
Convert queries of the form "where [jcr:primaryType] = 'x' or [jcr:primaryType] = 'y'" to "select ... -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
NODETYPE_OPTIMIZATION
public static final boolean NODETYPE_OPTIMIZATIONOptimize 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_UNIONConvert 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 Details
-
XPathToSQL2Converter
public XPathToSQL2Converter() -
XPathToSQL2Converter
-
-
Method Details
-
convert
Convert the query to SQL2.- Parameters:
query
- the query string- Returns:
- the SQL2 query
- Throws:
ParseException
- if parsing fails
-