This class is the representation of an XQuery in the Zorba engine.
More...
Detailed Description
This class is the representation of an XQuery in the Zorba engine.
To compile and execute an XQuery, an instance of this class must be created. This is done by using either the createQuery or compileQuery methods of the Zorba class.
- Examples:
- Test_Zorba.java.
Definition at line 27 of file XQuery.h.
Constructor & Destructor Documentation
XQuery::XQuery |
( |
const XQuery & |
aXQuery | ) |
|
XQuery::XQuery |
( |
zorba::XQuery_t |
aQuery | ) |
|
Member Function Documentation
void XQuery::compile |
( |
const std::string & |
aQuery | ) |
|
Compile a query given as a String.
- Parameters
-
aQuery | the query String to compile. |
- Exceptions
-
ZorbaException | if the query has been closed, is already compiled, or an error occurs while compiling the query. |
void XQuery::compile |
( |
const std::string & |
aQuery, |
|
|
StaticContext & |
aStaticContext |
|
) |
| |
Compile a query given as a String, using a given static context and compiler hints.
- Parameters
-
aQuery | the query String to compile. |
aStaticContext | the static context. |
- Exceptions
-
ZorbaException | if the query has been closed, is already compiled, or an error occurs while compiling the query. |
/brief deletes this object from memory
std::string XQuery::execute |
( |
| ) |
|
Execute the query.
The query can be executed with this function. The query only has a result if it's a non-updating query.
- Exceptions
-
ZorbaException | if an error occurs (e.g. the query is closed or has not been compiled or is not updating) |
- Examples:
- Test_Zorba.java.
Execute the query and write the result to the given output stream.
The query only has a result if it's a non-updating query.
- Parameters
-
stream | The output stream on which the result is written. |
Execute the query and write the result to the given output stream.
The query only has a result if it's a non-updating query.
- Parameters
-
stream | The output stream on which the result is written. |
serOptions | The serialization options for this Query result |
Execute the query.
The query can be executed with this function. The query only has a result if it's a non-updating query.
- Parameters
-
serOptions | The serialization options for this Query result |
- Exceptions
-
ZorbaException | if an error occurs (e.g. the query is closed or has not been compiled or is not updating) |
Get the dynamic context of this query.
This function returns the dynamic context that belongs to this query and is used during query execution. The context can be used, for example, to set values of external variables, the default collation, or the current datetime. It is only available if the query has been compiled, otherwise an error is reported. Moreover, the context must not be modified during the execution of a query (i.e. if a Iterator is opened). The lifetime of the context returned by this function is restricted by the lifetime of the according query object.
- Exceptions
-
SystemException | if the query has not been compiled or is closed. |
- Returns
- DynamicContext of this query.
void XQuery::getExternalVariables |
( |
Iterator & |
vars | ) |
const |
Returns the QName of all external variables.
- Parameters
-
vars | iterator to store the results. |
- Exceptions
-
ZorbaException | if an error occured. |
Returns a CollectionManager responsible for all collections which are statically declared in the static context of this query (main module) or any transitively imported library module.
The collection manager provides a set of functions for managing collections and their contents.
- Returns
- The collection manager responsible for managing collections of this query.
Get the static context of this query.
This function returns the static context that belongs to this query. The static context is only available if the query has been compiled, otherwise an error is reported. The context has all the components and values that were set in the static context that was passed when creating the query and those that were set in the prolog of the query. Note that after compilation of the query the static context is a read only structure. Moreover, the lifetime of the context returned by this function is restricted by the lifetime of the corresponding query object.
- Exceptions
-
SystemException | if the query has not been compiled or is closed. |
- Returns
- StaticContext of this query.
Get an iterator for the result of the query.
Allows an application to lazily execute the query, retrieving the result one item at a time.
- Returns
- Iterator iterator over the result sequence.
- Exceptions
-
ZorbaException | if an error occurs (e.g. the query is closed or has not been compiled). |
- Examples:
- Test_Zorba.java.
std::string XQuery::printPlanAsDOT |
( |
| ) |
|
Print the execution plan of this query to a given string.
- Returns
- A String with the output.
- Exceptions
-
ZorbaException | if the query has been closed or is not compiled. |
std::string XQuery::printPlanAsXML |
( |
| ) |
|
Print the execution plan of this query to a given string.
- Returns
- A String with the output.
- Exceptions
-
ZorbaException | if the query has been closed or is not compiled. |
The documentation for this class was generated from the following file: