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 javax.jcr.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,
javax.jcr.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. |
javax.jcr.query.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,
javax.jcr.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.
|
javax.jcr.Node |
storeAsNode(String absPath) |
protected SessionContext sessionContext
protected String statement
protected String language
protected ExecutableQuery query
protected javax.jcr.Node node
protected QueryHandler handler
protected long limit
protected long offset
public void init(SessionContext sessionContext, QueryHandler handler, String statement, String language, javax.jcr.Node node) throws javax.jcr.query.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.javax.jcr.query.InvalidQueryException
- if the query statement is invalid according
to the specified language
.public javax.jcr.query.QueryResult execute() throws javax.jcr.RepositoryException
execute
call to the
ExecutableQuery
object returned by
QueryHandler.createExecutableQuery(org.apache.jackrabbit.core.session.SessionContext, java.lang.String, java.lang.String)
.
javax.jcr.RepositoryException
public String getStatement()
public String getLanguage()
public String getStoredQueryPath() throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
javax.jcr.ItemNotFoundException
javax.jcr.RepositoryException
public javax.jcr.Node storeAsNode(String absPath) throws javax.jcr.ItemExistsException, javax.jcr.PathNotFoundException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.lock.LockException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
javax.jcr.ItemExistsException
javax.jcr.PathNotFoundException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
public String[] getBindVariableNames()
public void bindValue(String varName, javax.jcr.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-2020 The Apache Software Foundation. All Rights Reserved.