info.magnolia.cms.core.search
Class QueryManagerImpl

java.lang.Object
  extended by info.magnolia.cms.core.search.QueryManagerImpl
All Implemented Interfaces:
QueryManager

public class QueryManagerImpl
extends Object
implements QueryManager

Wrapping a JCR QueryManager. Date: Mar 29, 2005 Time: 2:54:21 PM

Author:
Sameer Charles

Field Summary
protected  HierarchyManager hm
           
protected  javax.jcr.query.QueryManager queryManager
           
 
Constructor Summary
protected QueryManagerImpl(javax.jcr.query.QueryManager queryManager, HierarchyManager hm)
           
 
Method Summary
 Query createQuery(String s, String s1)
          Description inherited from javax.jcr.query.QueryManager#createQuery(String, String)
Creates a new query by specifying the query statement itself and the language in which the query is stated.
 Query getQuery(javax.jcr.Node node)
          Description inherited from javax.jcr.query.QueryManager#getQuery(javax.jcr.Node)
Retrieves an existing persistent query.
 String[] getSupportedQueryLanguages()
          Description inherited from javax.jcr.query.QueryManager#getSupportedQueryLanguages()
Returns an array of strings representing all query languages supported by this repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryManager

protected javax.jcr.query.QueryManager queryManager

hm

protected HierarchyManager hm
Constructor Detail

QueryManagerImpl

protected QueryManagerImpl(javax.jcr.query.QueryManager queryManager,
                           HierarchyManager hm)
Method Detail

createQuery

public Query createQuery(String s,
                         String s1)
                  throws javax.jcr.query.InvalidQueryException,
                         javax.jcr.RepositoryException
Description copied from interface: QueryManager
Description inherited from javax.jcr.query.QueryManager#createQuery(String, String)
Creates a new query by specifying the query statement itself and the language in which the query is stated. If the query statement is syntactically invalid, given the language specified, an InvalidQueryException is thrown. The language must be a string from among those returned by QueryManager.getSupportedQueryLanguages(); if it is not, then an InvalidQueryException is thrown.

Specified by:
createQuery in interface QueryManager
Returns:
A Query object.
Throws:
javax.jcr.query.InvalidQueryException - if statement is invalid or language is unsupported.
javax.jcr.RepositoryException - if another error occurs

getQuery

public Query getQuery(javax.jcr.Node node)
               throws javax.jcr.query.InvalidQueryException,
                      javax.jcr.RepositoryException
Description copied from interface: QueryManager
Description inherited from javax.jcr.query.QueryManager#getQuery(javax.jcr.Node)
Retrieves an existing persistent query. If node is not a valid persisted query (that is, a node of type nt:query), an InvalidQueryException is thrown.

Persistent queries are created by first using QueryManager.createQuery to create a Query object and then calling Query.save to persist the query to a location in the workspace.

Specified by:
getQuery in interface QueryManager
Parameters:
node - a persisted query (that is, a node of type nt:query).
Returns:
a Query object.
Throws:
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 occurs

getSupportedQueryLanguages

public String[] getSupportedQueryLanguages()
                                    throws javax.jcr.RepositoryException
Description copied from interface: QueryManager
Description inherited from javax.jcr.query.QueryManager#getSupportedQueryLanguages()
Returns an array of strings representing all query languages supported by this repository. In level 1 this set must include the string represented by the constant Query.XPATH. If SQL is supported it must additionally include the string represented by the constant Query.SQL. An implementation may also support other languages as well. See Query.

Specified by:
getSupportedQueryLanguages in interface QueryManager
Returns:
An string array.
Throws:
javax.jcr.RepositoryException - if an error occurs.


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.