org.apache.jackrabbit.jcr2spi.query
Class QueryImpl

java.lang.Object
  extended by org.apache.jackrabbit.jcr2spi.query.QueryImpl
All Implemented Interfaces:
Query

public class QueryImpl
extends Object
implements Query

Provides the default implementation for a JCR query.


Field Summary
 
Fields inherited from interface javax.jcr.query.Query
SQL, XPATH
 
Constructor Summary
QueryImpl(Session session, ManagerProvider mgrProvider, ItemManager itemMgr, WorkspaceManager wspManager, Node node)
          Creates a query from a node.
QueryImpl(Session session, ManagerProvider mgrProvider, ItemManager itemMgr, WorkspaceManager wspManager, String statement, String language)
          Creates a new query.
 
Method Summary
 QueryResult execute()
           
 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(Session session,
                 ManagerProvider mgrProvider,
                 ItemManager itemMgr,
                 WorkspaceManager wspManager,
                 String statement,
                 String language)
          throws InvalidQueryException,
                 RepositoryException
Creates a new query.

Parameters:
session - the session that created this query.
mgrProvider - the manager provider.
itemMgr - the item manager of that session.
wspManager - the workspace manager that belongs to the session.
statement - the query statement.
language - the language of the query statement.
Throws:
InvalidQueryException - if the query is invalid.
RepositoryException

QueryImpl

public QueryImpl(Session session,
                 ManagerProvider mgrProvider,
                 ItemManager itemMgr,
                 WorkspaceManager wspManager,
                 Node node)
          throws InvalidQueryException,
                 RepositoryException
Creates a query from a node.

Parameters:
session - the session that created this query.
mgrProvider - the manager provider.
itemMgr - the item manager of that session.
wspManager - the workspace manager that belongs to the session.
node - the node from where to read the query.
Throws:
InvalidQueryException - if the query is invalid.
RepositoryException - if another error occurs while reading from the node.
Method Detail

execute

public QueryResult execute()
                    throws RepositoryException
Specified by:
execute in interface Query
Throws:
RepositoryException
See Also:
Query.execute()

getStatement

public String getStatement()
Specified by:
getStatement in interface Query
See Also:
Query.getStatement()

getLanguage

public String getLanguage()
Specified by:
getLanguage in interface Query
See Also:
Query.getLanguage()

getStoredQueryPath

public String getStoredQueryPath()
                          throws ItemNotFoundException,
                                 RepositoryException
Specified by:
getStoredQueryPath in interface Query
Throws:
ItemNotFoundException
RepositoryException
See Also:
Query.getStoredQueryPath()

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
See Also:
Query.storeAsNode(String)


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