public class QueryManagerImpl extends Object implements QueryManagerWrapper
QueryManager to support multiple providers.| Constructor and Description |
|---|
QueryManagerImpl(JCRSessionWrapper session,
JCRSessionFactory sessionFactory) |
| Modifier and Type | Method and Description |
|---|---|
QueryWrapper |
createDualQuery(String statement,
String language,
String sqlFallbackStatement)
Creates a new query by specifying the query
statement in xpath and
in SQL2. |
QueryWrapper |
createQuery(String statement,
String language)
Creates a new query by specifying the query
statement itself
and the language in which the query is stated. |
javax.jcr.query.qom.QueryObjectModelFactory |
getQOMFactory()
Returns a
QueryObjectModelFactory with which a JCR-JQOM
query can be built programmatically. |
QueryWrapper |
getQuery(javax.jcr.Node node)
Retrieves an existing persistent query.
|
String[] |
getSupportedQueryLanguages() |
public QueryManagerImpl(JCRSessionWrapper session, JCRSessionFactory sessionFactory)
public QueryWrapper createQuery(String statement, String language) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryException
QueryManagerWrapperstatement itself
and the language in which the query is stated. The
language must be a string from among those returned by
QueryManager.getSupportedQueryLanguages().createQuery in interface javax.jcr.query.QueryManagercreateQuery in interface QueryManagerWrapperstatement - a Stringlanguage - a StringQuery objectjavax.jcr.query.InvalidQueryException - if the query statement is syntactically
invalid or the specified language is not supported.javax.jcr.RepositoryException - if another error occurs.public QueryWrapper createDualQuery(String statement, String language, String sqlFallbackStatement) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryException
QueryManagerWrapperstatement in xpath and
in SQL2. XPath will be used against jackrabbit where SQL2 can be used as a fallback statement
in other providers, which may not support xpath.
QueryManager.getSupportedQueryLanguages().createDualQuery in interface QueryManagerWrapperstatement - a Stringlanguage - a StringsqlFallbackStatement - a StringQuery objectjavax.jcr.query.InvalidQueryException - if the query statement is syntactically
invalid or the specified language is not supported.javax.jcr.RepositoryException - if another error occurs.public javax.jcr.query.qom.QueryObjectModelFactory getQOMFactory()
QueryManagerWrapperQueryObjectModelFactory with which a JCR-JQOM
query can be built programmatically.getQOMFactory in interface javax.jcr.query.QueryManagergetQOMFactory in interface QueryManagerWrapperQueryObjectModelFactory objectpublic QueryWrapper getQuery(javax.jcr.Node node) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryException
QueryManagerWrapper
Persistent queries are created by first using QueryManager.createQuery(java.lang.String, java.lang.String) to create a Query object and then
calling Query.save to persist the query to a location in the
workspace.
getQuery in interface javax.jcr.query.QueryManagergetQuery in interface QueryManagerWrappernode - a persisted query (that is, a node of type
nt:query).Query object.javax.jcr.query.InvalidQueryException - If node is not a valid
persisted query (that is, a node of type nt:query).javax.jcr.RepositoryException - if another error occurspublic String[] getSupportedQueryLanguages() throws javax.jcr.RepositoryException
getSupportedQueryLanguages in interface javax.jcr.query.QueryManagerjavax.jcr.RepositoryExceptionCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.