public class QueryImpl
extends org.exoplatform.services.jcr.impl.core.query.AbstractQueryImpl
Modifier and Type | Field and Description |
---|---|
protected QueryHandler |
handler
The query handler for this query.
|
static String |
JCR_JQOM
A string constant representing the JCR-JQOM query language.
|
static String |
JCR_SQL2
A string constant representing the JCR-SQL2 query language.
|
protected String |
language
The syntax of the query statement
|
protected javax.jcr.Node |
node
The node where this query is persisted.
|
protected org.exoplatform.services.jcr.impl.core.query.ExecutableQuery |
query
The actual query implementation that can be executed
|
protected org.exoplatform.services.jcr.impl.core.SessionImpl |
session
The session of the user executing this query
|
protected String |
statement
The query statement
|
Constructor and Description |
---|
QueryImpl() |
Modifier and Type | Method and Description |
---|---|
void |
bindValue(String varName,
javax.jcr.Value value)
Binds the given
value to the variable named
varName . |
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.exoplatform.services.jcr.impl.core.SessionImpl, org.exoplatform.services.jcr.impl.core.SessionDataManager, java.lang.String, java.lang.String) . |
String |
getLanguage() |
String |
getStatement() |
String |
getStoredQueryPath() |
void |
init(org.exoplatform.services.jcr.impl.core.SessionImpl session,
org.exoplatform.services.jcr.impl.core.SessionDataManager itemMgr,
QueryHandler handler,
javax.jcr.Node node)
Initializes a query instance from a nt:query node.
|
void |
init(org.exoplatform.services.jcr.impl.core.SessionImpl session,
org.exoplatform.services.jcr.impl.core.SessionDataManager itemMgr,
QueryHandler handler,
String statement,
String language)
Initializes a query instance from a query string.
|
void |
setCaseInsensitiveOrder(boolean caseInsensitiveOrder)
Setter for
caseInsensitiveOrder field. |
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) |
public static final String JCR_SQL2
public static final String JCR_JQOM
protected org.exoplatform.services.jcr.impl.core.SessionImpl session
protected String statement
protected String language
protected org.exoplatform.services.jcr.impl.core.query.ExecutableQuery query
protected javax.jcr.Node node
protected QueryHandler handler
public void init(org.exoplatform.services.jcr.impl.core.SessionImpl session, org.exoplatform.services.jcr.impl.core.SessionDataManager itemMgr, QueryHandler handler, String statement, String language) throws javax.jcr.query.InvalidQueryException
init
in class org.exoplatform.services.jcr.impl.core.query.AbstractQueryImpl
session
- the session of the user executing this query.itemMgr
- the item manager of the session executing this query.handler
- the query handler of the search index.statement
- the query statement.language
- the syntax of the query statement.javax.jcr.query.InvalidQueryException
- if the query statement is invalid according
to the specified language
.public void init(org.exoplatform.services.jcr.impl.core.SessionImpl session, org.exoplatform.services.jcr.impl.core.SessionDataManager itemMgr, QueryHandler handler, javax.jcr.Node node) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryException
init
in class org.exoplatform.services.jcr.impl.core.query.AbstractQueryImpl
session
- the session of the user executing this query.itemMgr
- the item manager of the session executing this query.handler
- the query handler of the search index.node
- a node of type nt:query
.javax.jcr.query.InvalidQueryException
- If node
is not a valid persisted query
(that is, a node of type nt:query
).javax.jcr.RepositoryException
- if another error occurspublic javax.jcr.query.QueryResult execute() throws javax.jcr.RepositoryException
execute
call to the
ExecutableQuery
object returned by
QueryHandler.createExecutableQuery(org.exoplatform.services.jcr.impl.core.SessionImpl, org.exoplatform.services.jcr.impl.core.SessionDataManager, 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 void bindValue(String varName, javax.jcr.Value value) throws IllegalArgumentException, javax.jcr.RepositoryException
value
to the variable named
varName
.varName
- name of variable in queryvalue
- value to bindIllegalArgumentException
- if varName
is not a
valid variable in this query.javax.jcr.RepositoryException
- if an error occurs.public void setLimit(long limit)
limit
- new maximum size of the result setpublic void setOffset(long offset)
offset
- new start offset of the result setpublic void setCaseInsensitiveOrder(boolean caseInsensitiveOrder)
caseInsensitiveOrder
field.protected void setInitialized()
protected void checkNotInitialized()
IllegalStateException
if it is already initialized.protected void checkInitialized()
IllegalStateException
if it is not yet initialized.Copyright © 2003–2019 eXo Platform SAS. All rights reserved.