org.apache.turbine.torque.engine.database.transform
Class SQLToAppData

java.lang.Object
  |
  +--org.apache.turbine.torque.engine.database.transform.SQLToAppData

Deprecated. use turbine-torque

public class SQLToAppData
extends java.lang.Object

A Class that converts an sql input file to an AppData structure. The class makes use of SQL Scanner to get sql tokens and the parses these to create the AppData class. SQLToAppData is in effect a simplified sql parser.

Version:
$Id: SQLToAppData.java,v 1.2 2002/02/16 19:40:37 mpoeschl Exp $
Author:
Leon Messerschmidt, Jon S. Stevens

Field Summary
private  AppData appData
          Deprecated.  
private  Database appDataDB
          Deprecated.  
private  int count
          Deprecated.  
private  java.lang.String sqlFile
          Deprecated.  
private  Token token
          Deprecated.  
private  java.util.Vector tokens
          Deprecated.  
 
Constructor Summary
SQLToAppData()
          Deprecated. Create a new class without any input Reader.
SQLToAppData(java.lang.String sqlFile)
          Deprecated. Create a new class with an input Reader
 
Method Summary
private  void Create_Table_Column_Data(Table tbl)
          Deprecated. Parse the data definition of the column statement.
private  void Create_Table_Column_Foreign(Table tbl)
          Deprecated. Parses FOREIGN KEY (BAR) REFERENCES TABLE (BAR) statement
private  void Create_Table_Column_Primary(Table tbl)
          Deprecated. Parses PRIMARY KEY (FOO,BAR) statement
private  void Create_Table_Column_Unique(Table tbl)
          Deprecated. Parses UNIQUE (NAME,FOO,BAR) statement
private  void Create_Table_Column(Table tbl)
          Deprecated. Parses column information between the braces of a CREATE TABLE () sql statement.
private  void Create_Table()
          Deprecated. Parses a CREATE TABLE sql command
private  void Create()
          Deprecated. Parses a CREATE TABLE FOO command.
private  void err(java.lang.String name)
          Deprecated. Creates an error condition and adds the line and column number of the current token to the error message.
 AppData execute()
          Deprecated. Execute the parser.
 java.lang.String getSqlFile()
          Deprecated. Get the current input sql file
private  boolean hasTokens()
          Deprecated. Check if there is more tokens available for parsing.
static void main(java.lang.String[] args)
          Deprecated. Just 4 testing.
private  void next()
          Deprecated. Move to the next token.
 void setSqlFile(java.lang.String sqlFile)
          Deprecated. Set the current input sql file
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

sqlFile

private java.lang.String sqlFile
Deprecated. 

tokens

private java.util.Vector tokens
Deprecated. 

token

private Token token
Deprecated. 

appData

private AppData appData
Deprecated. 

appDataDB

private Database appDataDB
Deprecated. 

count

private int count
Deprecated. 
Constructor Detail

SQLToAppData

public SQLToAppData()
Deprecated. 
Create a new class without any input Reader.

SQLToAppData

public SQLToAppData(java.lang.String sqlFile)
Deprecated. 
Create a new class with an input Reader
Method Detail

getSqlFile

public java.lang.String getSqlFile()
Deprecated. 
Get the current input sql file

setSqlFile

public void setSqlFile(java.lang.String sqlFile)
Deprecated. 
Set the current input sql file

next

private void next()
           throws ParseException
Deprecated. 
Move to the next token. Throws an exception if there is no more tokens available.

err

private void err(java.lang.String name)
          throws ParseException
Deprecated. 
Creates an error condition and adds the line and column number of the current token to the error message.

hasTokens

private boolean hasTokens()
Deprecated. 
Check if there is more tokens available for parsing.

Create

private void Create()
             throws ParseException
Deprecated. 
Parses a CREATE TABLE FOO command.

Create_Table

private void Create_Table()
                   throws ParseException
Deprecated. 
Parses a CREATE TABLE sql command

Create_Table_Column

private void Create_Table_Column(Table tbl)
                          throws ParseException
Deprecated. 
Parses column information between the braces of a CREATE TABLE () sql statement.

Create_Table_Column_Primary

private void Create_Table_Column_Primary(Table tbl)
                                  throws ParseException
Deprecated. 
Parses PRIMARY KEY (FOO,BAR) statement

Create_Table_Column_Unique

private void Create_Table_Column_Unique(Table tbl)
                                 throws ParseException
Deprecated. 
Parses UNIQUE (NAME,FOO,BAR) statement

Create_Table_Column_Foreign

private void Create_Table_Column_Foreign(Table tbl)
                                  throws ParseException
Deprecated. 
Parses FOREIGN KEY (BAR) REFERENCES TABLE (BAR) statement

Create_Table_Column_Data

private void Create_Table_Column_Data(Table tbl)
                               throws ParseException
Deprecated. 
Parse the data definition of the column statement.

execute

public AppData execute()
                throws java.io.IOException,
                       ParseException
Deprecated. 
Execute the parser.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Deprecated. 
Just 4 testing.


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