XmlQueryContext.setReturnType |
![]() ![]() |
import com.sleepycat.dbxml.*;public void setReturnType(int type) throws XmlException; public int setReturnType() throws XmlException;
The XmlQueryContext.setReturnType method allows the application to define whether the query should return documents, or values, or both.
The ResultDocuments return type instructs the query processor to select documents from the container that match the query expression. A document is said to match the query if the execution of the query over the document would return a value for that document. The query returns an XmlResults object that contains a list of XmlValues of type XmlValue.DOCUMENT.
The ResultValues return type instructs the query processor to select documents from the container that match the query expression, and to return the result of executing the query over the document. The query returns an XmlResults object that contains a list of XmlValues of type UNREF==XmlValue_NODE. The XmlValues contain deep copies of the result nodes, meaning that all descendant child nodes are also copied.
The ResultDocumentsAndValues return type instructs the query processor to return both documents and values. It behaves just as ResultValues does, returning an XmlResults object that contains a list of XmlValues of type UNREF==XmlValue_NODE. The difference being that the containing XmlDocument can be retrieved by calling the XmlValue.asDocument method.
The CandidateDocuments return type instructs the query processor to return documents that match the query, but only using the available indices. Under normal processing the matching documents returned from the indices are filtered through a query processor that applies the query against the document. For some query expressions the caller might know that the candidate set is equivalent to the result set. For these expressions there is no need to pass the candidate documents through a filter to eliminate false positives. The query processor can identify some query expressions of this nature, but not all. The CandidateDocuments return type allows the client application to do its own false-positive elimination.
Discover the return type defined for this XmlQueryContext.
Returns the return type defined for this XmlQueryContext.
![]() ![]() |
Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.