Class SQL2QOMBuilder
java.lang.Object
org.apache.jackrabbit.commons.query.sql2.SQL2QOMBuilder
- All Implemented Interfaces:
QueryObjectModelBuilder
SQL2QOMBuilder
implements QOM builder that understands
Query.JCR_SQL2
and Query.JCR_JQOM
. JCR_JQOM
might be surprising, but JSR 283 says that the serialization format of
JCR_JQOM
is JCR_SQL2
. This is important when
a JQOM is stored on a node as a serialized String and a language property
set to JCR_JQOM
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if this QOM builder can handle a statement inlanguage
.createQueryObjectModel
(String statement, QueryObjectModelFactory qf, ValueFactory vf) Creates a new query object model from the givenstatement
using the passed QOM and value factory.String[]
Returns the set of query languages supported by this builder.toString
(QueryObjectModel qom) Creates a String representation of the query object model in the syntax thisQueryObjectModelBuilder
can handle.
-
Constructor Details
-
SQL2QOMBuilder
public SQL2QOMBuilder()
-
-
Method Details
-
createQueryObjectModel
public QueryObjectModel createQueryObjectModel(String statement, QueryObjectModelFactory qf, ValueFactory vf) throws InvalidQueryException, RepositoryException Creates a new query object model from the givenstatement
using the passed QOM and value factory.- Specified by:
createQueryObjectModel
in interfaceQueryObjectModelBuilder
- Parameters:
statement
- the query statement.qf
- the query object model factory.vf
- the value factory.- Returns:
- the query object model for the given statement.
- Throws:
InvalidQueryException
- if the statement is invalid.RepositoryException
- if another error occurs.
-
canHandle
Returnstrue
if this QOM builder can handle a statement inlanguage
.- Specified by:
canHandle
in interfaceQueryObjectModelBuilder
- Parameters:
language
- the language of a query statement to build a QOM.- Returns:
true
if this builder can handlelanguage
;false
otherwise.
-
getSupportedLanguages
Returns the set of query languages supported by this builder.- Specified by:
getSupportedLanguages
in interfaceQueryObjectModelBuilder
- Returns:
- String array containing the names of the supported languages.
-
toString
Creates a String representation of the query object model in the syntax thisQueryObjectModelBuilder
can handle.- Specified by:
toString
in interfaceQueryObjectModelBuilder
- Parameters:
qom
- the query object model.- Returns:
- a String representation of the QOM.
- Throws:
InvalidQueryException
- if the query object model cannot be converted into a String representation due to restrictions in this syntax.
-