org.apache.turbine.torque
Class TorqueJDBCTransformTask

org.apache.turbine.torque.TorqueJDBCTransformTask

Deprecated. use turbine-torque

public class TorqueJDBCTransformTask

This class generates an XML schema of an existing database from JDBC metadata.

Version:
$Id: TorqueJDBCTransformTask.java,v 1.2 2002/02/16 19:40:36 mpoeschl Exp $
Author:
Jason van Zyl, Fedor Karpelevitch

Field Summary
protected  org.w3c.dom.Node appData
          Deprecated.  
protected  java.util.Hashtable columnTableMap
          Deprecated. Hashtable to track what table a column belongs to.
protected  org.w3c.dom.Node database
          Deprecated.  
protected  java.lang.String dbDriver
          Deprecated. JDBC driver.
protected  java.lang.String dbPassword
          Deprecated. JDBC password.
protected  java.lang.String dbUrl
          Deprecated. JDBC URL.
protected  java.lang.String dbUser
          Deprecated. JDBC user name.
protected  org.apache.xerces.dom.DocumentImpl doc
          Deprecated. DOM document produced.
protected  java.util.Hashtable primaryKeys
          Deprecated. Hashtable of columns that have primary keys.
protected  boolean sameJavaName
          Deprecated.  
protected  java.lang.String xmlSchema
          Deprecated. Name of XML database schema produced.
(package private)  org.apache.xml.serialize.XMLSerializer xmlSerializer
          Deprecated.  
 
Constructor Summary
TorqueJDBCTransformTask()
          Deprecated.  
 
Method Summary
 void execute()
          Deprecated. Default constructor.
 void generateXML()
          Deprecated. Generates an XML database schema from JDBC metadata.
 java.util.Vector getColumns(java.sql.DatabaseMetaData dbMeta, java.lang.String tableName)
          Deprecated. Retrieves all the column names and types for a given table from JDBC metadata.
 java.util.Collection getForeignKeys(java.sql.DatabaseMetaData dbMeta, java.lang.String tableName)
          Deprecated. Retrieves a list of foreign key columns for a given table.
 java.util.List getPrimaryKeys(java.sql.DatabaseMetaData dbMeta, java.lang.String tableName)
          Deprecated. Retrieves a list of the columns composing the primary key for a given table.
 java.util.Vector getTableNames(java.sql.DatabaseMetaData dbMeta)
          Deprecated. Get all the table names in the current database that are not system tables.
 boolean isSameJavaName()
          Deprecated.  
 void setDbDriver(java.lang.String v)
          Deprecated.  
 void setDbPassword(java.lang.String v)
          Deprecated.  
 void setDbUrl(java.lang.String v)
          Deprecated.  
 void setDbUser(java.lang.String v)
          Deprecated.  
 void setOutputFile(java.lang.String v)
          Deprecated.  
 void setSameJavaName(boolean v)
          Deprecated.  
 

Field Detail

xmlSchema

protected java.lang.String xmlSchema
Deprecated. 
Name of XML database schema produced.

dbUrl

protected java.lang.String dbUrl
Deprecated. 
JDBC URL.

dbDriver

protected java.lang.String dbDriver
Deprecated. 
JDBC driver.

dbUser

protected java.lang.String dbUser
Deprecated. 
JDBC user name.

dbPassword

protected java.lang.String dbPassword
Deprecated. 
JDBC password.

doc

protected org.apache.xerces.dom.DocumentImpl doc
Deprecated. 
DOM document produced.

database

protected org.w3c.dom.Node database
Deprecated. 

appData

protected org.w3c.dom.Node appData
Deprecated. 

primaryKeys

protected java.util.Hashtable primaryKeys
Deprecated. 
Hashtable of columns that have primary keys.

columnTableMap

protected java.util.Hashtable columnTableMap
Deprecated. 
Hashtable to track what table a column belongs to.

sameJavaName

protected boolean sameJavaName
Deprecated. 

xmlSerializer

org.apache.xml.serialize.XMLSerializer xmlSerializer
Deprecated. 
Constructor Detail

TorqueJDBCTransformTask

public TorqueJDBCTransformTask()
Deprecated. 
Method Detail

setDbUrl

public void setDbUrl(java.lang.String v)
Deprecated. 

setDbDriver

public void setDbDriver(java.lang.String v)
Deprecated. 

setDbUser

public void setDbUser(java.lang.String v)
Deprecated. 

setDbPassword

public void setDbPassword(java.lang.String v)
Deprecated. 

setOutputFile

public void setOutputFile(java.lang.String v)
Deprecated. 

setSameJavaName

public void setSameJavaName(boolean v)
Deprecated. 

isSameJavaName

public boolean isSameJavaName()
Deprecated. 

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Deprecated. 
Default constructor.

generateXML

public void generateXML()
                 throws java.lang.Exception
Deprecated. 
Generates an XML database schema from JDBC metadata.
Throws:
Exception, - a generic exception.

getTableNames

public java.util.Vector getTableNames(java.sql.DatabaseMetaData dbMeta)
                               throws java.sql.SQLException
Deprecated. 
Get all the table names in the current database that are not system tables.
Parameters:
dbMeta - JDBC database metadata.
Returns:
A Vector with all the tables in a database.
Throws:
SQLException. -  

getColumns

public java.util.Vector getColumns(java.sql.DatabaseMetaData dbMeta,
                                   java.lang.String tableName)
                            throws java.sql.SQLException
Deprecated. 
Retrieves all the column names and types for a given table from JDBC metadata. It returns a vector of vectors. Each element of the returned vector is a vector with: element 0 => a String object for the column name. element 1 => an Integer object for the column type. element 2 => size of the column. element 3 => null type.
Parameters:
dbMeta - JDBC metadata.
tableName - Table from which to retrieve column information.
Returns:
A Vector with the list of columns in tableName.

getPrimaryKeys

public java.util.List getPrimaryKeys(java.sql.DatabaseMetaData dbMeta,
                                     java.lang.String tableName)
                              throws java.sql.SQLException
Deprecated. 
Retrieves a list of the columns composing the primary key for a given table.
Parameters:
dbMeta - JDBC metadata.
tableName - Table from which to retrieve PK information.
Returns:
A list of the primary key parts for tableName.

getForeignKeys

public java.util.Collection getForeignKeys(java.sql.DatabaseMetaData dbMeta,
                                           java.lang.String tableName)
                                    throws java.sql.SQLException
Deprecated. 
Retrieves a list of foreign key columns for a given table.
Parameters:
dbMeta - JDBC metadata.
tableName - Table from which to retrieve FK information.
Returns:
A list of foreign keys in tableName.


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.