|
Berkeley DB XML version 2.3.10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.dbxml.XmlQueryExpression
public class XmlQueryExpression
An XmlQueryExpression represents a parsed XQuery expression, and is
created by a call to XmlManager.prepare(java.lang.String, com.sleepycat.dbxml.XmlQueryContext)
. Parsed XQuery
expressions are useful because they allow the cost of query parsing and
optimization to be amortized over many evaluations.
The copy constructor is provided for this class. The class is implemented using a handle-body idiom. When a handle is copied both handles maintain a reference to the same body.
There are two basic forms of the execute
method: one that takes an XmlValue
object, and another that does not. For methods that do
not take an XmlValue, the XQuery must restrict the scope of the query
using either the collection()
or the doc()
XQuery navigation functions, or an exception is thrown.
For those forms of the execute
method that take an XmlValue
, the query is applied against that object.
This object is free-threaded, and can be safely shared among threads, once
created. Each thread should use an unshared XmlQueryContext
object for
calls to execute(com.sleepycat.dbxml.XmlQueryContext)
.
Constructor Summary | |
---|---|
XmlQueryExpression(XmlQueryExpression queryExpression)
Copy constructor. |
Method Summary | |
---|---|
void |
delete()
Free the native resources associated with this object. |
XmlResults |
execute(XmlQueryContext queryContext)
Evaluates the XQuery expression against the containers and documents identified by the query. |
XmlResults |
execute(XmlQueryContext queryContext,
XmlDocumentConfig config)
Evaluates the XQuery expression against the containers and documents identified by the query, with configuration. |
XmlResults |
execute(XmlTransaction txn,
XmlQueryContext queryContext)
Evaluates the XQuery expression against the containers and documents identified by the query, from within the scope of the provided XmlTransaction object. |
XmlResults |
execute(XmlTransaction txn,
XmlQueryContext queryContext,
XmlDocumentConfig config)
Evaluates the XQuery expression against the containers and documents identified by the query, from within the scope of the provided XmlTransaction object, with configuration. |
XmlResults |
execute(XmlTransaction txn,
XmlValue contextItem,
XmlQueryContext queryContext)
Evaluates the XQuery expression against the provided context item in the given query context, from within the scope of the provided XmlTransaction object. |
XmlResults |
execute(XmlTransaction txn,
XmlValue contextItem,
XmlQueryContext queryContext,
XmlDocumentConfig config)
Evaluates the XQuery expression against the provided context item, from within the scope of the provided XmlTransaction object. |
XmlResults |
execute(XmlValue contextItem,
XmlQueryContext queryContext)
Evaluates the XQuery expression against the provided context item in the given query context. |
XmlResults |
execute(XmlValue contextItem,
XmlQueryContext queryContext,
XmlDocumentConfig config)
Evaluates the XQuery expression against the provided context item in the given query context with configuration. |
String |
getQuery()
Returns the query as a string. |
String |
getQueryPlan()
Returns the query plan as a string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlQueryExpression(XmlQueryExpression queryExpression) throws XmlException
XmlException
Method Detail |
---|
public void delete()
public XmlResults execute(XmlQueryContext queryContext) throws XmlException
queryContext
- The XmlQueryContext
to use for this evaluation.
XmlException
public XmlResults execute(XmlQueryContext queryContext, XmlDocumentConfig config) throws XmlException
queryContext
- The XmlQueryContext
to use for this evaluation.config
- The configuration settings for the execution.
XmlException
public XmlResults execute(XmlTransaction txn, XmlQueryContext queryContext) throws XmlException
XmlTransaction
object.
txn
- If the operation is to be transaction-protected, the txn
parameter is an XmlTransaction
handle returned from
XmlManager.createTransaction()
.queryContext
- The XmlQueryContext
to use for this evaluation.
XmlException
public XmlResults execute(XmlTransaction txn, XmlQueryContext queryContext, XmlDocumentConfig config) throws XmlException
XmlTransaction
object, with configuration.
txn
- If the operation is to be transaction-protected, the txn
parameter is an XmlTransaction
handle returned from
XmlManager.createTransaction()
.queryContext
- The XmlQueryContext
to use for this evaluation.config
- The configuration settings for the execution.
XmlException
public XmlResults execute(XmlValue contextItem, XmlQueryContext queryContext) throws XmlException
contextItem
- The XmlValue
object to perform the query against.queryContext
- The XmlQueryContext
to use for this evaluation.
XmlException
public XmlResults execute(XmlValue contextItem, XmlQueryContext queryContext, XmlDocumentConfig config) throws XmlException
contextItem
- The XmlValue
object to perform the query against.queryContext
- The XmlQueryContext
to use for this evaluation.config
- The configuration settings for the execution.
XmlException
public XmlResults execute(XmlTransaction txn, XmlValue contextItem, XmlQueryContext queryContext) throws XmlException
XmlTransaction
object.
txn
- If the operation is to be transaction-protected, the txn
parameter is an XmlTransaction
handle returned from
XmlManager.createTransaction()
.contextItem
- The XmlValue
object to perform the query against.queryContext
- The XmlQueryContext
to use for this evaluation.
XmlException
public XmlResults execute(XmlTransaction txn, XmlValue contextItem, XmlQueryContext queryContext, XmlDocumentConfig config) throws XmlException
XmlTransaction
object.
txn
- If the operation is to be transaction-protected, the txn
parameter is an XmlTransaction
handle returned from
XmlManager.createTransaction()
.contextItem
- The XmlValue
object to perform the query against.queryContext
- The XmlQueryContext
to use for this evaluation.config
- The configuration settings for the execution.
XmlException
public String getQuery() throws XmlException
XmlException
public String getQueryPlan() throws XmlException
XmlException
|
Berkeley DB XML version 2.3.10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |