org.exolab.castor.dtx
Class DTXEngine
java.lang.Object
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.
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:05 $
DTXEngine() - Default constructor.
|
DTXEngine(String databaseURL, String schemaURL) - Construct a DTXEngine for the given JDO mapping file and
XML schema.
|
_classMappings
protected HashMap _classMappings
_conn
protected Connection _conn
_databaseURL
protected String _databaseURL
_handler
protected DocumentHandler _handler
_logWriter
protected PrintWriter _logWriter
_schema
protected Schema _schema
_schemaURL
protected String _schemaURL
DTXEngine
public DTXEngine()
Default constructor.
DTXEngine
public DTXEngine(String databaseURL,
String schemaURL)
throws DTXException
Construct a DTXEngine for the given JDO mapping file and
XML schema.
databaseURL
- URL string for JDO mapping file.schemaURL
- URL string for XML Schema file.
getClassMapping
(package private) ClassMapping getClassMapping(String className)
getConnection
(package private) Connection getConnection()
throws DTXException
getDatabase
(package private) Database getDatabase()
getSchema
(package private) Schema getSchema()
prepareQuery
public DTXQuery prepareQuery(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).
oql
- OQL string for the query.
setDatabase
public void setDatabase(String databaseURL)
throws DTXException
Sets the database options from a JDO database mapping file.
databaseURL
- URL string for JDO database mapping file.
setDocumentHandler
public void setDocumentHandler(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.
handler
- A DocumentHandler to receive query results as
SAX events.
setLogWriter
public void setLogWriter(PrintWriter logWriter)
Sets the log writer for this DTX engine. Individual
queries will use this writer by default, but it can be
overwritten on a per-query basis.
logWriter
- A PrintWriter to use for logging.
setSchema
public void setSchema(String schemaURL)
throws DTXException
Sets the XML Schema to use. Parses and prepares the Schema.
schemaURL
- URL string for XML Schema file.
Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com