Download Stylus Studio - The World's Best XML Development Environment!


com.ddtek.jxtr
Class JXTRQuery

java.lang.Object
  |
  +--com.ddtek.jxtr.JXTRBase
        |
        +--com.ddtek.jxtr.JXTRQueryBase
              |
              +--com.ddtek.jxtr.JXTRQuery

public class JXTRQuery
extends JXTRQueryBase

JXTRQuery implements all processing required to generate an XML document from a jXTransformer query.

A JXTRQuery object is created by passing a JDBC connection object and a valid jXTransformer query (as a string) to the constructor JXTRQuery(Connection,String).

Once the JXTRQuery object has been created, the following methods support further customizing of the resulting XML.

Once the JXTRQuery object is created and customized, the method used to execute the jXTransformer query depends on the target format of the XML document.

Alternatively one can request a resultset type of view on the created XML. When invoking executeQuery(), an object of type JXTRResultSet is returned.

XML meta information that describes the XML result for the jXTransformer can be generated through the following methods.

For more information, see the following available resources:

To support the preceding features, Connect for SQL/XML is installed with:


Field Summary
static int EMPTY_ELEMENT_CREATED
          "Empty element" create behavior.
static int EMPTY_ELEMENT_NOT_CREATED
          "Empty element" create behavior.
static int EMPTY_ELEMENT_NOTSET
          "Empty element" create behavior.
static int NESTED_LOOP
          Constant for nested loop rewrite algorithm.
static int NOT_SET
          Constant to indicate when rewrite algorithm information is not available.
static int ORDER_BY_ORDINAL_EXPR_IN_XML
          Semantics of 'order by '.
static int ORDER_BY_ORDINAL_EXPR_NOT_IN_XML
          Semantics of 'order by '.
static int ORDER_BY_ORDINAL_NOTSET
          Semantics of 'order by '.
static int OUTER_UNION
          Constant for outer union rewrite algorithm.
static int SORTED_OUTER_UNION
          Constant for sorted outer union rewrite algorithm.
static int XML_EXPLICIT
          Constant for XML explicit rewrite algorithm.
static int XMLTYPE
          Constant to be considered an extension to java.sql.types.
 
Fields inherited from class com.ddtek.jxtr.JXTRQueryBase
JDBC_PREPARED_STAT, JDBC_STAT, JDBC_STATTYPE_NOTSET
 
Fields inherited from class com.ddtek.jxtr.JXTRBase
BINARY_AS_BASE64, BINARY_AS_HEX, TIMESTAMP_AS_ISO8601, TIMESTAMP_AS_ODBC
 
Constructor Summary
JXTRQuery(java.sql.Connection con, java.lang.String jxtrStat)
          Constructs a JXTRQuery object based on the provided JDBC connection and jXTransformer query text.
JXTRQuery(java.sql.Connection con, java.lang.String jxtrStat, int rewriteAlgorithm)
          Constructs a JXTRQuery object based on the provided JDBC connection, jXTransformer query, and rewrite algorithm.
 
Method Summary
 void close()
          Closes database prepared statement(s).
 void dump(java.io.Writer dumpTo)
          Dumps the JXTRQuery internal structure.
 org.w3c.dom.Document executeDOM()
          Executes the jXTransformer query and returns the XML result as a DOM level 2 document object.
 void executeDOM(org.w3c.dom.Node domNode)
          Executes the jXTransformer query and creates the XML result under the specified DOM level 2 node.
 org.jdom.Document executeJDOM()
          Executes the jXTransformer query and returns a JDOM document.
 void executeJDOM(org.jdom.Element domElement)
          Executes the jXTransformer query and creates the XML result under the specified JDOM element node.
 JXTRResultSet executeQuery()
          Executes a jXTransformer query and returns XML values in a result set.
 void executeSAX(org.xml.sax.XMLReader xmlReader)
          Executes the jXTransformer query and invokes SAX2 callbacks registered with the specified XMLReader.
 void executeWriter(java.io.Writer xmlWriter, boolean outputDocHeader)
          Executes the jXTransformer query and writes the XML as a character stream to the specified writer, which should use UTF-8 encoding.
 void executeWriter(java.io.Writer xmlWriter, boolean outputDocHeader, int indentLevel)
          Executes the jXTransformer query and writes the XML result as a character stream to the specified writer, which should use UTF-8 encoding.
 void executeWriter(java.io.Writer xmlWriter, boolean outputDocHeader, java.lang.String encoding)
          Executes the jXTransformer query and writes the XML result as a character stream to the specified writer, which should use the specified encoding.
 void executeWriter(java.io.Writer xmlWriter, boolean outputDocHeader, java.lang.String encoding, int indentLevel)
          Executes the jXTransformer query and writes the XML as a character stream to the specified writer, which should use the specified encoding.
 void generateDTD(java.io.Writer dtdWriter)
          Generates a DTD describing the structure of the jXTransformer query result and writes the DTD to the specified Writer.
 void generateXMLSchema(java.util.Map targetNamespaceSchemaFileMap)
          Generates multiple XML Schemas describing the structure of the jXTransformer query result.
 void generateXMLSchema(java.util.Map targetNamespaceSchemaFileMap, int indentLevel)
          Generates multiple XML Schemas describing the structure of the jXTransformer query result.
 void generateXMLSchema(java.util.Map targetNamespaceSchemaFileMap, java.lang.String encoding)
          Generates multiple XML Schemas describing the structure of the jXTransformer query result.
 void generateXMLSchema(java.util.Map targetNamespaceSchemaFileMap, java.lang.String encoding, int indentLevel)
          Generates multiple XML Schemas describing the structure of the jXTransformer query result.
 void generateXMLSchema(java.io.Writer schemaWriter)
          Generates an XML Schema describing the structure of the jXTransformer query result and writes the XML Schema to the specified Writer.
 void generateXMLSchema(java.io.Writer schemaWriter, java.lang.String targetNamespace)
          Generates an XML Schema describing the structure of the jXTransformer query result and writes the XML Schema to the specified Writer, which should use UTF-8 encoding.
 void generateXMLSchema(java.io.Writer schemaWriter, java.lang.String targetNamespace, int indentLevel)
          Generates an XML Schema describing the structure of the jXTransformer query result and writes the XML Schema to the specified Writer, which should use UTF-8 encoding.
 void generateXMLSchema(java.io.Writer schemaWriter, java.lang.String targetNamespace, java.lang.String encoding)
          Generates an XML Schema describing the structure of the jXTransformer query result and writes the result to the specified Writer, which should use the specified encoding.
 void generateXMLSchema(java.io.Writer schemaWriter, java.lang.String targetNamespace, java.lang.String encoding, int indentLevel)
          Generates an XML Schema describing the structure of the jXTransformer query result and writes the XML Schema to the specified Writer, which should use the specified encoding.
 int getAlgorithm()
          Returns the rewrite algorithm used to process the query.
 int getEmptyElementCreateBehavior()
          Returns create behavior for empty elements for this jXTransformer query.
 int getOrderByOrdinalBehavior()
          Returns order by ordinal behavior for this jXTransformer query.
 void setEmptyElementCreateBehavior(int emptyElementCreateBehavior)
          Sets behavior for empty elements.
 void setOrderByOrdinalBehavior(int orderByOrdinalBehavior)
          Sets behavior of order by expressions.
 
Methods inherited from class com.ddtek.jxtr.JXTRQueryBase
addDocumentComment, addDocumentPI, addRootAttribute, addRootNameSpace, addRootNameSpace, getBinaryEncoding, getDatabaseExtension, getJDBCStatType, getPreferredJDBCStatType, getTimestampEncoding, setBigDecimal, setBinaryEncoding, setBoolean, setByte, setBytes, setDatabaseExtension, setDate, setDouble, setExternalDTD, setExternalDTD, setFloat, setInt, setLong, setNull, setNullReplacementValue, setObject, setObject, setObject, setPreferredJDBCStatType, setRootTag, setShort, setString, setTime, setTimestamp, setTimestampEncoding
 
Methods inherited from class com.ddtek.jxtr.JXTRBase
clearWarnings, getPreparedStatementCloseBehaviour, getWarnings, setPreparedStatementCloseBehaviour, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_SET

public static final int NOT_SET
Constant to indicate when rewrite algorithm information is not available. Returned from getAlgorithm() before the jXTransformer query is executed.


NESTED_LOOP

public static final int NESTED_LOOP
Constant for nested loop rewrite algorithm. See JXTRQuery(java.sql.Connection, java.lang.String, int) and getAlgorithm().


OUTER_UNION

public static final int OUTER_UNION
Constant for outer union rewrite algorithm. See JXTRQuery(java.sql.Connection, java.lang.String, int) and getAlgorithm().


SORTED_OUTER_UNION

public static final int SORTED_OUTER_UNION
Constant for sorted outer union rewrite algorithm. See JXTRQuery(java.sql.Connection, java.lang.String, int) and getAlgorithm().


XML_EXPLICIT

public static final int XML_EXPLICIT
Constant for XML explicit rewrite algorithm. See JXTRQuery(java.sql.Connection, java.lang.String, int) and getAlgorithm().


XMLTYPE

public static final int XMLTYPE
Constant to be considered an extension to java.sql.types. Numeric type value for XML types columns

See Also:
Constant Field Values

ORDER_BY_ORDINAL_NOTSET

public static final int ORDER_BY_ORDINAL_NOTSET
Semantics of 'order by '. Constant requesting default behavior. See setOrderByOrdinalBehavior(int)

See Also:
Constant Field Values

ORDER_BY_ORDINAL_EXPR_IN_XML

public static final int ORDER_BY_ORDINAL_EXPR_IN_XML
Semantics of 'order by '. Indicates that order by constructs are allowed to point to selected expressions inside XML constructs. See setOrderByOrdinalBehavior(int)

See Also:
Constant Field Values

ORDER_BY_ORDINAL_EXPR_NOT_IN_XML

public static final int ORDER_BY_ORDINAL_EXPR_NOT_IN_XML
Semantics of 'order by '. Indicates that order by constructs always point to top-level Select list expressions and cannot point to expressions inside XML constructs. In this case, the number cannot refer to a column that contains XML constructs. See setOrderByOrdinalBehavior(int)

See Also:
Constant Field Values

EMPTY_ELEMENT_NOT_CREATED

public static final int EMPTY_ELEMENT_NOT_CREATED
"Empty element" create behavior. Empty elements are not created. (jXTransformer 1.1 compatible). See setEmptyElementCreateBehavior(int)

See Also:
Constant Field Values

EMPTY_ELEMENT_CREATED

public static final int EMPTY_ELEMENT_CREATED
"Empty element" create behavior. Empty elements are created. SQL/XML compatible behavior: See setEmptyElementCreateBehavior(int)

See Also:
Constant Field Values

EMPTY_ELEMENT_NOTSET

public static final int EMPTY_ELEMENT_NOTSET
"Empty element" create behavior. Behavior not set. See setEmptyElementCreateBehavior(int)

See Also:
Constant Field Values
Constructor Detail

JXTRQuery

public JXTRQuery(java.sql.Connection con,
                 java.lang.String jxtrStat)
          throws JXTRException
Constructs a JXTRQuery object based on the provided JDBC connection and jXTransformer query text.

Parameters:
con - Reference to an open JDBC connection. The connection must remain open until the last 'execute' has been invoked.
jxtrStat - jXTransformer query to execute.
Throws:
JXTRException - Refer to the JXTRException class for more information about error conditions.
See Also:
JXTRException

JXTRQuery

public JXTRQuery(java.sql.Connection con,
                 java.lang.String jxtrStat,
                 int rewriteAlgorithm)
          throws JXTRException
Constructs a JXTRQuery object based on the provided JDBC connection, jXTransformer query, and rewrite algorithm.

Parameters:
con - Reference to an open JDBC connection. The connection must be kept open until the last 'execute' has been invoked.
jxtrStat - jXTransformer query to execute.
rewriteAlgorithm - A supported rewrite algorithm (either NESTED_LOOP, OUTER_UNION, SORTED_OUTER_UNION, or XML_EXPLICIT).
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException
Method Detail

close

public void close()
           throws JXTRException
Description copied from class: JXTRBase
Closes database prepared statement(s).

Specified by:
close in class JXTRBase
Throws:
JXTRException - if an error occured during closing of resources or database statement(s).

executeDOM

public org.w3c.dom.Document executeDOM()
                                throws JXTRException
Description copied from class: JXTRQueryBase
Executes the jXTransformer query and returns the XML result as a DOM level 2 document object.

To create the DOM level 2 object, Connect for SQL/XML uses JAXP 1.1. Any DOM level 2 implementation that supports JAXP 1.1 can be used.

Specified by:
executeDOM in class JXTRQueryBase
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException

executeDOM

public void executeDOM(org.w3c.dom.Node domNode)
                throws JXTRException
Description copied from class: JXTRQueryBase
Executes the jXTransformer query and creates the XML result under the specified DOM level 2 node.

Specified by:
executeDOM in class JXTRQueryBase
Parameters:
domNode - DOM level 2 node under which the XML result will be created.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException

executeWriter

public void executeWriter(java.io.Writer xmlWriter,
                          boolean outputDocHeader)
                   throws JXTRException
Description copied from class: JXTRQueryBase
Executes the jXTransformer query and writes the XML as a character stream to the specified writer, which should use UTF-8 encoding.

Specified by:
executeWriter in class JXTRQueryBase
Parameters:
xmlWriter - Writer to which the XML result will be streamed.
outputDocHeader - When set to false, no XML document header or root element will be created. When set to true, a complete XML document will be created with a document header and root element. If a root element is not specified, a default root element of jxtr-result will be used (see JXTRQueryBase.setRootTag(String)).
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException

executeWriter

public void executeWriter(java.io.Writer xmlWriter,
                          boolean outputDocHeader,
                          int indentLevel)
                   throws JXTRException
Description copied from class: JXTRQueryBase
Executes the jXTransformer query and writes the XML result as a character stream to the specified writer, which should use UTF-8 encoding. Each element level in the XML result is indented by the specified number of spaces.

Specified by:
executeWriter in class JXTRQueryBase
Parameters:
xmlWriter - Writer to which the XML document will be streamed.
outputDocHeader - When set to false, no XML document header or root element will be created. When set to true, a complete XML document will be created with a document header and root element. If a root element is not specified, a default root element of jxtr-result will be used (see JXTRQueryBase.setRootTag(String)).
indentLevel - Number of spaces each element level will be indented.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException

executeWriter

public void executeWriter(java.io.Writer xmlWriter,
                          boolean outputDocHeader,
                          java.lang.String encoding)
                   throws JXTRException
Description copied from class: JXTRQueryBase
Executes the jXTransformer query and writes the XML result as a character stream to the specified writer, which should use the specified encoding.

Specified by:
executeWriter in class JXTRQueryBase
Parameters:
xmlWriter - Writer to which the XML result will be streamed.
outputDocHeader - When set to false, no XML document header or root element will be created. When set to true, a complete XML document will be created with a document header and root element. If a root element is not specified, a default root element of jxtr-result will be used (see JXTRQueryBase.setRootTag(String)).
encoding - Encoding the specified writer will use.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException

executeWriter

public void executeWriter(java.io.Writer xmlWriter,
                          boolean outputDocHeader,
                          java.lang.String encoding,
                          int indentLevel)
                   throws JXTRException
Description copied from class: JXTRQueryBase
Executes the jXTransformer query and writes the XML as a character stream to the specified writer, which should use the specified encoding. Each element level in the resulting XML is indented the specified number of spaces.

Specified by:
executeWriter in class JXTRQueryBase
Parameters:
xmlWriter - Writer to which the XML document will be streamed.
outputDocHeader - When set to false, no XML document header or root element is created. When set to true, a complete XML document is created with a document header and root element. If a root element is not specified, a default root element of jxtr-result will be used (see JXTRQueryBase.setRootTag(String)).
encoding - Encoding the specified writer will use.
indentLevel - Number of spaces each element level will be indented.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException

executeJDOM

public org.jdom.Document executeJDOM()
                              throws JXTRException
Description copied from class: JXTRQueryBase
Executes the jXTransformer query and returns a JDOM document.

Specified by:
executeJDOM in class JXTRQueryBase
Returns:
Generated JDOM document.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException, org.jdom.Document

executeJDOM

public void executeJDOM(org.jdom.Element domElement)
                 throws JXTRException
Description copied from class: JXTRQueryBase
Executes the jXTransformer query and creates the XML result under the specified JDOM element node.

Specified by:
executeJDOM in class JXTRQueryBase
Parameters:
domElement - JDOM element node under which the resulting XML will be created.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException

executeSAX

public void executeSAX(org.xml.sax.XMLReader xmlReader)
                throws JXTRException
Description copied from class: JXTRQueryBase
Executes the jXTransformer query and invokes SAX2 callbacks registered with the specified XMLReader.

The xmlReader must be an object of type JXTRSaxReader or the xmlReader features must be set as supported by JXTRSaxReader.

Specified by:
executeSAX in class JXTRQueryBase
Parameters:
xmlReader - SAX2 XML Reader whose registered handlers will receive the SAX2 events.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException

executeQuery

public JXTRResultSet executeQuery()
                           throws JXTRException
Executes a jXTransformer query and returns XML values in a result set.

Instead of returning one merged XML result, as is the case with all other execute methods, JXTRResultSet allows you to scroll through the resulting XML on a row by row basis.

Throws:
JXTRException
See Also:
JXTRResultSet

dump

public void dump(java.io.Writer dumpTo)
          throws JXTRException
Description copied from class: JXTRQueryBase
Dumps the JXTRQuery internal structure. Only used for troubleshooting purposes.

Specified by:
dump in class JXTRQueryBase
Parameters:
dumpTo - Writer to which the information will be dumped.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException

getAlgorithm

public int getAlgorithm()
                 throws JXTRException
Returns the rewrite algorithm used to process the query. Possible values are NESTED_LOOP, OUTER_UNION, SORTED_OUTER_UNION, XML_EXPLICIT, and NOT_SET.

Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
JXTRException
See Also:
JXTRException

generateDTD

public void generateDTD(java.io.Writer dtdWriter)
                 throws JXTRException
Description copied from class: JXTRQueryBase
Generates a DTD describing the structure of the jXTransformer query result and writes the DTD to the specified Writer.

Specified by:
generateDTD in class JXTRQueryBase
Parameters:
dtdWriter - Writer to which the DTD will be written.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException

generateXMLSchema

public void generateXMLSchema(java.io.Writer schemaWriter)
                       throws JXTRException
Description copied from class: JXTRQueryBase
Generates an XML Schema describing the structure of the jXTransformer query result and writes the XML Schema to the specified Writer. The generated XML Schema is compliant with the W3C Recommendation, 2 May 2001.

Specified by:
generateXMLSchema in class JXTRQueryBase
Parameters:
schemaWriter - Writer to which the XML Schema will be written.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException, XML Schema Part 0: Primer, XML Schema Part 1: Structures, XML Schema Part 2: Datatypes

generateXMLSchema

public void generateXMLSchema(java.io.Writer schemaWriter,
                              java.lang.String targetNamespace)
                       throws JXTRException
Description copied from class: JXTRQueryBase
Generates an XML Schema describing the structure of the jXTransformer query result and writes the XML Schema to the specified Writer, which should use UTF-8 encoding. An XML Schema is generated for the specified namespace. The generated XML Schema is compliant with the W3C Recommendation, 2 May 2001.

Specified by:
generateXMLSchema in class JXTRQueryBase
Parameters:
schemaWriter - Writer to which the XML Schema will be written.
targetNamespace - Namespace for which the XML Schema will be generated or null to generate an XML Schema for those elements/attributes that do not have a namespace.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException, XML Schema Part 0: Primer, XML Schema Part 1: Structures, XML Schema Part 2: Datatypes

generateXMLSchema

public void generateXMLSchema(java.io.Writer schemaWriter,
                              java.lang.String targetNamespace,
                              java.lang.String encoding)
                       throws JXTRException
Description copied from class: JXTRQueryBase
Generates an XML Schema describing the structure of the jXTransformer query result and writes the result to the specified Writer, which should use the specified encoding. An XML Schema is generated for the specified namespace. The generated XML Schema is compliant with the W3C Recommendation, 2 May 2001.

Specified by:
generateXMLSchema in class JXTRQueryBase
Parameters:
schemaWriter - Writer to which the XML Schema will be written.
targetNamespace - Namespace for which the XML Schema will be generated or null to generate an XML Schema for those elements/attributes that do not have a namespace.
encoding - Encoding the specified writer will use.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException, XML Schema Part 0: Primer, XML Schema Part 1: Structures, XML Schema Part 2: Datatypes

generateXMLSchema

public void generateXMLSchema(java.io.Writer schemaWriter,
                              java.lang.String targetNamespace,
                              int indentLevel)
                       throws JXTRException
Description copied from class: JXTRQueryBase
Generates an XML Schema describing the structure of the jXTransformer query result and writes the XML Schema to the specified Writer, which should use UTF-8 encoding. The element levels in the generated XML Schema are indented by the specified number of spaces. The generated XML Schema is compliant with the W3C Recommendation, 2 May 2001.

Specified by:
generateXMLSchema in class JXTRQueryBase
Parameters:
schemaWriter - Writer to which the XML Schema will be written.
targetNamespace - Namespace for which the XML Schema will be generated or null to generate an XML Schema for those elements/attributes that do not have a namespace.
indentLevel - Number of spaces to indent each element level.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException, XML Schema Part 0: Primer, XML Schema Part 1: Structures, XML Schema Part 2: Datatypes

generateXMLSchema

public void generateXMLSchema(java.io.Writer schemaWriter,
                              java.lang.String targetNamespace,
                              java.lang.String encoding,
                              int indentLevel)
                       throws JXTRException
Description copied from class: JXTRQueryBase
Generates an XML Schema describing the structure of the jXTransformer query result and writes the XML Schema to the specified Writer, which should use the specified encoding. An XML Schema is generated for the specified namespace. The element levels in the generated XML Schema are indented by the specified number of spaces. The generated XML Schema is compliant with the W3C Recommendation, 2 May 2001.

Specified by:
generateXMLSchema in class JXTRQueryBase
Parameters:
schemaWriter - Writer to which the XML Schema is written.
targetNamespace - Namespace for which the XML Schema will be generated or null to generate an XML Schema for those elements/attributes that do not have a namespace.
encoding - Encoding the specified writer will use.
indentLevel - Number of spaces to indent each element level.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException, XML Schema Part 0: Primer, XML Schema Part 1: Structures, XML Schema Part 2: Datatypes

generateXMLSchema

public void generateXMLSchema(java.util.Map targetNamespaceSchemaFileMap)
                       throws JXTRException
Description copied from class: JXTRQueryBase
Generates multiple XML Schemas describing the structure of the jXTransformer query result. The specified HashMap maps namespace URIs to filenames. As a result, one XML Schema is generated for each specified namespace. Each XML Schema is written using UTF-8 encoding in the specified file associated with the namespace. The generated XML Schemas are compliant with the W3C Recommendation, 2 May 2001.

Specified by:
generateXMLSchema in class JXTRQueryBase
Parameters:
targetNamespaceSchemaFileMap - Map containing the namespaces (keys) and their associated output XML Schema filenames (values). A null key is used to generate XML Schemas for elements/attributes that do not have a namespace.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException, XML Schema Part 0: Primer, XML Schema Part 1: Structures, XML Schema Part 2: Datatypes

generateXMLSchema

public void generateXMLSchema(java.util.Map targetNamespaceSchemaFileMap,
                              java.lang.String encoding)
                       throws JXTRException
Description copied from class: JXTRQueryBase
Generates multiple XML Schemas describing the structure of the jXTransformer query result. The specified HashMap maps namespace URIs to filenames. As a result, one XML Schema is generated for each specified namespace. Each XML Schema is written using the specified encoding in the specified file associated with the namespace. The generated XML Schemas are compliant with the W3C Recommendation, 2 May 2001.

Specified by:
generateXMLSchema in class JXTRQueryBase
Parameters:
targetNamespaceSchemaFileMap - Map containing the namespaces (keys) and their associated output XML Schema filenames (values). A null key is used to generate XML Schemas for elements/attributes that do not have a namespace.
encoding - Encoding the specified writer will use.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException, XML Schema Part 0: Primer, XML Schema Part 1: Structures, XML Schema Part 2: Datatypes

generateXMLSchema

public void generateXMLSchema(java.util.Map targetNamespaceSchemaFileMap,
                              int indentLevel)
                       throws JXTRException
Description copied from class: JXTRQueryBase
Generates multiple XML Schemas describing the structure of the jXTransformer query result. The specified HashMap maps namespace URIs to filenames. As a result, one XML Schema is generated for each specified namespace. Each XML Schema is written using UTF-8 encoding in the file associated with the specified namespace. Element levels in the generated XML Schemas are indented by the specified number of spaces. The generated XML Schemas are compliant with the W3C Recommendation, 2 May 2001.

Specified by:
generateXMLSchema in class JXTRQueryBase
Parameters:
targetNamespaceSchemaFileMap - Map containing the namespaces (keys) and their associated output XML Schema filenames (values). A null key is used to generate XML Schemas for elements/attributes that do not have a namespace.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException, XML Schema Part 0: Primer, XML Schema Part 1: Structures, XML Schema Part 2: Datatypes

generateXMLSchema

public void generateXMLSchema(java.util.Map targetNamespaceSchemaFileMap,
                              java.lang.String encoding,
                              int indentLevel)
                       throws JXTRException
Description copied from class: JXTRQueryBase
Generates multiple XML Schemas describing the structure of the jXTransformer query result. The specified HashMap maps namespace URIs to filenames. As a result, one XML Schema is generated for each specified namespace. The XML Schemas are written using the specified encoding in the file associated with the specified namespace. Element levels in the generated XML Schemas are indented by the specified number of spaces. The generated XML Schemas are compliant with the W3C Recommendation, 2 May 2001.

Specified by:
generateXMLSchema in class JXTRQueryBase
Parameters:
targetNamespaceSchemaFileMap - Map containing the namespaces (keys) and their associated output XML Schema filenames (values). A null key is used to generate XML Schemas for elements/attributes that do not have a namespace.
encoding - Encoding the specified writer will use.
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException, XML Schema Part 0: Primer, XML Schema Part 1: Structures, XML Schema Part 2: Datatypes

setOrderByOrdinalBehavior

public void setOrderByOrdinalBehavior(int orderByOrdinalBehavior)
                               throws JXTRException
Sets behavior of order by expressions.

order by expressions can be interpreted in two different ways.

When specifying ORDER_BY_ORDINAL_IN_XML, the ordinal number can refer to expressions that can be located inside XML constructs. Each 'selected expression' (inside or outside an XML construct) gets a unique sequence number.

When specifying ORDER_BY_ORDINAL_NOT_IN_XML, the ordinal number cannot refer to expressions inside XML constructs. The sequence numbers are determined by counting the top-level expressions, including XML constructs.

Example select e.Title, xml_element('emp', xml_attribute('id',e.EmpId), xml_element('name',e.FirstName)), e.StartDate from Employees e order by 3

When using ORDER_BY_ORDINAL_IN_XML, the result is sorted on e.FirstName, but when using ORDER_BY_ORDINAL_NOT_IN_XML the result is sorted on e.StartDate.

Parameters:
orderByOrdinalBehavior - one of ORDER_BY_ORDINAL_IN_XML or ORDER_BY_ORDINAL_NOT_IN_XML.
Throws:
JXTRException

getOrderByOrdinalBehavior

public int getOrderByOrdinalBehavior()
Returns order by ordinal behavior for this jXTransformer query.

See Also:
setOrderByOrdinalBehavior(int)

setEmptyElementCreateBehavior

public void setEmptyElementCreateBehavior(int emptyElementCreateBehavior)
                                   throws JXTRException
Sets behavior for empty elements.

When using EMPTY_ELEMENT_CREATED, an empty element will be created when a NULL value is fetched from the database. This setting matches the SQL/XML semantics.

When using EMPTY_ELEMENT_NOT_CREATED, no element will be created. This setting matches jXTransformer 1.1 behavior.

Throws:
JXTRException

getEmptyElementCreateBehavior

public int getEmptyElementCreateBehavior()
Returns create behavior for empty elements for this jXTransformer query.

See Also:
setEmptyElementCreateBehavior(int)


Stylus Studio features SQL/XML tools for building XML views of relational data.