org.apache.jackrabbit.core.query
Class QueryImpl

java.lang.Object
  extended byorg.apache.jackrabbit.core.query.QueryImpl
All Implemented Interfaces:
Query

public class QueryImpl
extends Object
implements Query

Implements the Query interface.


Field Summary
 
Fields inherited from interface javax.jcr.query.Query
SQL, XPATH
 
Constructor Summary
QueryImpl(SessionImpl session, ItemManager itemMgr, QueryHandler handler, Node node)
          Create a new query instance from a nt:query node.
QueryImpl(SessionImpl session, ItemManager itemMgr, QueryHandler handler, String statement, String language)
          Creates a new query instance from a query string.
 
Method Summary
 QueryResult execute()
          This method simply forwards the execute call to the ExecutableQuery object returned by QueryHandler.createExecutableQuery(org.apache.jackrabbit.core.SessionImpl, org.apache.jackrabbit.core.ItemManager, java.lang.String, java.lang.String).
 String getLanguage()
          
 String getStatement()
          
 String getStoredQueryPath()
          
 Node storeAsNode(String absPath)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryImpl

public QueryImpl(SessionImpl session,
                 ItemManager itemMgr,
                 QueryHandler handler,
                 String statement,
                 String language)
          throws InvalidQueryException
Creates a new query instance from a query string.

Parameters:
session - the session of the user executing this query.
itemMgr - the item manager of the session executing this query.
handler - the query handler of the search index.
statement - the query statement.
language - the syntax of the query statement.
Throws:
InvalidQueryException - if the query statement is invalid according to the specified language.

QueryImpl

public QueryImpl(SessionImpl session,
                 ItemManager itemMgr,
                 QueryHandler handler,
                 Node node)
          throws InvalidQueryException,
                 RepositoryException
Create a new query instance from a nt:query node.

Parameters:
session - the session of the user executing this query.
itemMgr - the item manager of the session executing this query.
handler - the query handler of the search index.
node - a node of type nt:query.
Throws:
InvalidQueryException - If node is not a valid persisted query (that is, a node of type nt:query).
RepositoryException - if another error occurs
Method Detail

execute

public QueryResult execute()
                    throws RepositoryException
This method simply forwards the execute call to the ExecutableQuery object returned by QueryHandler.createExecutableQuery(org.apache.jackrabbit.core.SessionImpl, org.apache.jackrabbit.core.ItemManager, java.lang.String, java.lang.String).

Specified by:
execute in interface Query
Throws:
RepositoryException

getStatement

public String getStatement()

Specified by:
getStatement in interface Query

getLanguage

public String getLanguage()

Specified by:
getLanguage in interface Query

getStoredQueryPath

public String getStoredQueryPath()
                          throws ItemNotFoundException,
                                 RepositoryException

Specified by:
getStoredQueryPath in interface Query
Throws:
ItemNotFoundException
RepositoryException

storeAsNode

public Node storeAsNode(String absPath)
                 throws ItemExistsException,
                        PathNotFoundException,
                        VersionException,
                        ConstraintViolationException,
                        LockException,
                        UnsupportedRepositoryOperationException,
                        RepositoryException

Specified by:
storeAsNode in interface Query
Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
UnsupportedRepositoryOperationException
RepositoryException


Copyright © 2004-2005 The Apache Software Foundation. All Rights Reserved.