org.apache.jackrabbit.jcr2spi.query
Class QueryImpl

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

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
JCR_JQOM, JCR_SQL2, SQL, XPATH
 
Constructor Summary
QueryImpl(Session session, ManagerProvider mgrProvider, ItemManager itemMgr, WorkspaceManager wspManager, String statement, String language, Node node)
          Creates a new query.
 
Method Summary
 void bindValue(String varName, Value value)
           
 QueryResult execute()
           
 String[] getBindVariableNames()
           
 String getLanguage()
           
 String getStatement()
           
 String getStoredQueryPath()
           
 void setLimit(long limit)
           
 void setOffset(long offset)
           
 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,
                 Node node)
          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.
node - the node from where the query was read or null if this query is not a stored query.
Throws:
InvalidQueryException - if the query is invalid.
RepositoryException
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)

getBindVariableNames

public String[] getBindVariableNames()
                              throws RepositoryException
Specified by:
getBindVariableNames in interface Query
Throws:
RepositoryException
See Also:
Query.getBindVariableNames()

bindValue

public void bindValue(String varName,
                      Value value)
               throws RepositoryException
Specified by:
bindValue in interface Query
Throws:
RepositoryException
See Also:
Query.bindValue(String, Value)

setLimit

public void setLimit(long limit)
Specified by:
setLimit in interface Query
See Also:
Query.setLimit(long)

setOffset

public void setOffset(long offset)
Specified by:
setOffset in interface Query
See Also:
Query.setOffset(long)


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