@NotThreadSafe public class JcrQuery extends JcrAbstractQuery
Query
that represents a query command
.context, language, statement
FULL_TEXT_SEARCH
Constructor and Description |
---|
JcrQuery(JcrQueryContext context,
String statement,
String language,
QueryCommand query,
PlanHints hints,
Path storedAtPath)
Creates a new JCR
Query by specifying the query statement itself, the language in which the query is stated, the
QueryCommand representation and, optionally, the node from which the query was loaded. |
Modifier and Type | Method and Description |
---|---|
void |
bindValue(String varName,
Value value) |
boolean |
cancel()
Signal that the query, if currently
executing , should be cancelled and stopped (with an exception). |
QueryResult |
execute() |
QueryResult |
explain()
Generates a plan for the this query and returns a
object that contains no results (nodes
or rows) but does have a query plan. |
QueryCommand |
getAbstractQueryModel()
Get the underlying and immutable Abstract Query Model representation of this query.
|
String |
getAbstractQueryModelRepresentation()
Get the underlying and immutable Abstract Query Model representation of this query.
|
String[] |
getBindVariableNames() |
void |
includeSystemContent(boolean includeSystemContent)
Specify whether the system content should be included in the query results.
|
protected QueryCommand |
query() |
void |
setLimit(long limit) |
void |
setOffset(long offset) |
String |
toString() |
protected Set<String> |
variableNames() |
checkForProblems, context, getLanguage, getStatement, getStoredQueryPath, pathFor, storeAsNode
public JcrQuery(JcrQueryContext context, String statement, String language, QueryCommand query, PlanHints hints, Path storedAtPath)
Query
by specifying the query statement itself, the language in which the query is stated, the
QueryCommand
representation and, optionally, the node from which the query was loaded. The language must be a
string from among those returned by QueryManager#getSupportedQueryLanguages()
.context
- the context that was used to create this query and that will be used to execute this query; may not be nullstatement
- the original statement as supplied by the client; may not be nulllanguage
- the language obtained from the QueryParser
; may not be nullquery
- the parsed query representation; may not be nullhints
- any hints that are to be used; may be null if there are no hintsstoredAtPath
- the path at which this query was stored, or null if this is not a stored querypublic void includeSystemContent(boolean includeSystemContent)
Query
includeSystemContent
- true if the system content should be included, or false if it should be excludedprotected QueryCommand query()
public QueryCommand getAbstractQueryModel()
public String getAbstractQueryModelRepresentation()
Query
public QueryResult execute() throws RepositoryException
RepositoryException
Query.execute()
public QueryResult explain() throws RepositoryException
Query
QueryResult
object that contains no results (nodes
or rows) but does have a query plan.
If this Query
contains a variable (see BindVariableValue
) which
has not been bound to a value (see Query.bindValue(java.lang.String, javax.jcr.Value)
) then this method throws an InvalidQueryException
.
QueryResult
objectInvalidQueryException
- if the query contains an unbound variable.RepositoryException
- if another error occurs.Query.execute()
public boolean cancel()
Query
executing
, should be cancelled and stopped (with an exception).
This method does not block until the query is actually stopped.public String toString()
toString
in class Object
Object.toString()
public void bindValue(String varName, Value value) throws IllegalArgumentException, RepositoryException
public String[] getBindVariableNames()
public void setLimit(long limit)
public void setOffset(long offset)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.