public class QueryImpl extends AbstractQueryImpl
| Modifier and Type | Field and Description | 
|---|---|
| protected QueryHandler | handlerThe query handler for this query. | 
| protected String | languageThe syntax of the query statement | 
| protected long | limitThe maximum result size | 
| protected Node | nodeThe node where this query is persisted. | 
| protected long | offsetThe offset in the total result set | 
| protected ExecutableQuery | queryThe actual query implementation that can be executed | 
| protected SessionContext | sessionContextComponent context of the current session | 
| protected String | statementThe query statement | 
| Constructor and Description | 
|---|
| QueryImpl() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | bindValue(String varName,
         Value value)Throws an  IllegalArgumentExceptionas XPath and SQL1 queries
 have no bind variables. | 
| protected void | checkInitialized()Checks if this query is initialized and throws an
  IllegalStateExceptionif it is not yet initialized. | 
| protected void | checkNotInitialized()Checks if this query is not yet initialized and throws an
  IllegalStateExceptionif it is already initialized. | 
| QueryResult | execute()This method simply forwards the  executecall to theExecutableQueryobject returned byQueryHandler.createExecutableQuery(org.apache.jackrabbit.core.session.SessionContext, java.lang.String, java.lang.String). | 
| String[] | getBindVariableNames() | 
| String | getLanguage() | 
| String | getStatement() | 
| String | getStoredQueryPath() | 
| void | init(SessionContext sessionContext,
    QueryHandler handler,
    String statement,
    String language,
    Node node)Initialises a query instance from a query string. | 
| protected void | setInitialized()Sets the initialized flag. | 
| void | setLimit(long limit)Sets the maximum size of the result set. | 
| void | setOffset(long offset)Sets the start offset of the result set. | 
| Node | storeAsNode(String absPath) | 
protected SessionContext sessionContext
protected String statement
protected String language
protected ExecutableQuery query
protected Node node
protected QueryHandler handler
protected long limit
protected long offset
public void init(SessionContext sessionContext, QueryHandler handler, String statement, String language, Node node) throws InvalidQueryException
init in class AbstractQueryImplsessionContext - component context of the current sessionhandler - the query handler of the search index.statement - the query statement.language - the syntax of the query statement.node - a nt:query node where the query was read from or
                  null if it is not a stored query.InvalidQueryException - if the query statement is invalid according
                               to the specified language.public QueryResult execute() throws RepositoryException
execute call to the
 ExecutableQuery object returned by
 QueryHandler.createExecutableQuery(org.apache.jackrabbit.core.session.SessionContext, java.lang.String, java.lang.String).
 RepositoryExceptionpublic String getStatement()
public String getLanguage()
public String getStoredQueryPath() throws ItemNotFoundException, RepositoryException
public Node storeAsNode(String absPath) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, UnsupportedRepositoryOperationException, RepositoryException
public String[] getBindVariableNames()
public void bindValue(String varName, Value value) throws IllegalArgumentException
IllegalArgumentException as XPath and SQL1 queries
 have no bind variables.IllegalArgumentException - always thrownpublic void setLimit(long limit)
limit - new maximum size of the result setpublic void setOffset(long offset)
offset - new start offset of the result setprotected void setInitialized()
protected void checkNotInitialized()
IllegalStateException if it is already initialized.protected void checkInitialized()
IllegalStateException if it is not yet initialized.Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.