public class QueryImpl extends AbstractQueryImpl
Modifier and Type | Field and Description |
---|---|
protected QueryHandler |
handler
The query handler for this query.
|
protected String |
language
The syntax of the query statement
|
protected long |
limit
The maximum result size
|
protected Node |
node
The node where this query is persisted.
|
protected long |
offset
The offset in the total result set
|
protected ExecutableQuery |
query
The actual query implementation that can be executed
|
protected SessionContext |
sessionContext
Component context of the current session
|
protected String |
statement
The query statement
|
Constructor and Description |
---|
QueryImpl() |
Modifier and Type | Method and Description |
---|---|
void |
bindValue(String varName,
Value value)
Throws an
IllegalArgumentException as XPath and SQL1 queries
have no bind variables. |
protected void |
checkInitialized()
Checks if this query is initialized and throws an
IllegalStateException if it is not yet initialized. |
protected void |
checkNotInitialized()
Checks if this query is not yet initialized and throws an
IllegalStateException if it is already initialized. |
QueryResult |
execute()
This method simply forwards the
execute call to the
ExecutableQuery object returned by
QueryHandler.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 AbstractQueryImpl
sessionContext
- 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)
.
RepositoryException
public 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–2024 The Apache Software Foundation. All rights reserved.