org.exolab.castor.dtx
Class DTXEngine

java.lang.Object
  extended by org.exolab.castor.dtx.DTXEngine

public class DTXEngine
extends java.lang.Object

An OQL query engine for hitting JDO data sources and generating SAX events. It skips the intermediate Java class step used by e.g. Castor JDO. The engine uses the SQL and XML descriptions in an XML Schema file and a Castor JDO mapping file to determine how to map results of the query into SAX events.

Version:
$Revision: 7950 $ $Date: 2006-04-08 05:10:21 -0600 (Sat, 08 Apr 2006) $
Author:
Evan Prodromou

Constructor Summary
DTXEngine()
          Default constructor.
DTXEngine(java.lang.String databaseURL, java.lang.String schemaURL)
          Construct a DTXEngine for the given JDO mapping file and XML schema.
 
Method Summary
 DTXQuery prepareQuery(java.lang.String oql)
          Prepare a new DTXQuery object, given an OQL string.
 void setDatabase(java.lang.String databaseURL)
          Sets the database options from a JDO database mapping file.
 void setDocumentHandler(org.xml.sax.DocumentHandler handler)
          Sets the default SAX document handler for this DTX engine.
 void setSchema(java.lang.String schemaURL)
          Sets the XML Schema to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTXEngine

public DTXEngine()
Default constructor.


DTXEngine

public DTXEngine(java.lang.String databaseURL,
                 java.lang.String schemaURL)
          throws DTXException
Construct a DTXEngine for the given JDO mapping file and XML schema.

Parameters:
databaseURL - URL string for JDO mapping file.
schemaURL - URL string for XML Schema file.
Throws:
DTXException
Method Detail

setSchema

public void setSchema(java.lang.String schemaURL)
               throws DTXException
Sets the XML Schema to use. Parses and prepares the Schema.

Parameters:
schemaURL - URL string for XML Schema file.
Throws:
DTXException

setDatabase

public void setDatabase(java.lang.String databaseURL)
                 throws DTXException
Sets the database options from a JDO database mapping file.

Parameters:
databaseURL - URL string for JDO database mapping file.
Throws:
DTXException

setDocumentHandler

public void setDocumentHandler(org.xml.sax.DocumentHandler handler)
Sets the default SAX document handler for this DTX engine. Individual queries will use this handler by default, but it can be overwritten on a per-query basis.

Parameters:
handler - A DocumentHandler to receive query results as SAX events.

prepareQuery

public DTXQuery prepareQuery(java.lang.String oql)
                      throws DTXException
Prepare a new DTXQuery object, given an OQL string. The syntax is currently limited only to SELECT statements that return a single object type (although multiple results will appear as multiple documents to the DocumentHandler).

Parameters:
oql - OQL string for the query.
Throws:
DTXException


Copyright © 2011. All Rights Reserved.