|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.sahits.codegen.java.input.SQLCreateScriptInput
ch.sahits.codegen.java.input.db.OracleSQLCreateScriptInputParser
public final class OracleSQLCreateScriptInputParser
This input parser handles the case of
a Oracle create sql script as an input. E.g.
CREATE TABLE user (
NAME varchar2(30) not null,
SURNAME varchar2(30) not null,
EMAIL varchar2(30) not null
);
CREATE UNIQUE INDEX PK_USER ON USER (EMAIL)
| Field Summary |
|---|
| Fields inherited from class ch.sahits.codegen.java.input.SQLCreateScriptInput |
|---|
initialized, state |
| Fields inherited from interface ch.sahits.codegen.java.input.db.IOracleCreateToken |
|---|
BEFORE, BITMAP, INSERT, TRIGGER |
| Fields inherited from interface ch.sahits.codegen.java.input.ISQLCreateToken |
|---|
CLOSE_CURLY_BRACE, CREATE, CREATE_DELIMITER, FIELD_DEFLIMITER, INDEX, LEFT_PARENTHESIS, NOT, NULL, ON, OPEN_CURLY_BRACE, RIGHT_PARENTHESIS, TABLE, UNIQUE |
| Constructor Summary | |
|---|---|
OracleSQLCreateScriptInputParser()
Default constructor needed for initialization as an extension. |
|
| Method Summary | |
|---|---|
java.lang.Class |
convert2JavaType(java.lang.String type)
Convert the corresponding Java type for a database type. |
java.lang.String |
getDatabaseName()
Get the name of the database that is used for initialization of the wizard. |
java.lang.String |
getDefaultHost()
Get the default value for the host for a database product that is used for initialization of the wizard e.g. |
int |
getDefaultPort()
Get the default port number for a database product that is used for initialization of the wizard e.g. '1521'. |
java.lang.String |
getDefaultUser()
Get the default user name for a database product that is used for initialization of the wizard e.g. |
java.lang.String |
getFileExtension()
Only sql create scripts in an sql file can be parsed |
java.lang.String |
getPassword()
Get the password of the database for the user name specified at IDBInputParser.getDefaultUser() that is used for initialization
of the wizard. |
int |
getRanking()
This method rates the implementation. |
int |
getWorkload()
Defines how complex the generation of the model is. |
boolean |
hasSchema()
Indicates if this database works through schemas |
protected boolean |
hasTypeSize(java.lang.String type)
Check if the type has any size property. |
void |
init(java.lang.Object createFileName)
Initialize the the parser with a file name to be parsed |
void |
init(java.lang.String inputFile)
Initialize the parser with the file |
protected boolean |
isAutogenKey(java.lang.String fieldName,
IDataBaseTable dbt)
Check if a trigger is defined for the field on insert that referres to a sequence that fills the field true if such a trigger exists. |
protected boolean |
isIndexConstraintToken(java.lang.String token)
Check if the token is a Index constraint token. |
protected DataBaseTable |
parseTable(java.util.StringTokenizer st,
java.lang.String className)
Parse the script for the table definition. |
| Methods inherited from class ch.sahits.codegen.java.input.SQLCreateScriptInput |
|---|
createIndexName, getLines, needsDataBaseInformationForCompleetion, parse, parseIndex, parseTable, readFile, unquote |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OracleSQLCreateScriptInputParser()
init(Object)
| Method Detail |
|---|
public void init(java.lang.Object createFileName)
throws java.io.FileNotFoundException,
java.io.IOException
init in interface IDBInputParsercreateFileName - name of the file to be parsed
java.io.FileNotFoundException - file could not be found
java.io.IOException - File could not be readpublic void init(java.lang.String inputFile)
init in interface IInputParserinputFile - public java.lang.Class convert2JavaType(java.lang.String type)
| Oracle Datatype | Java Object |
|---|---|
| VARCHAR2 | String |
| NVARCHAR2 | String |
| VARCHAR | String |
| CHAR | String |
| NCHAR | String |
| NUMBER(size) | long |
| NUMBER(p,s) | double |
| LONG | String |
| DATE | java.sql.Date |
| TIMESTAMP | long |
| ROWID | java.math.BigInteger |
| UROWID | java.math.BigInteger |
| CLOB | String |
| NCLOB | String |
convert2JavaType in interface IDBInputParsertype - database type
protected DataBaseTable parseTable(java.util.StringTokenizer st,
java.lang.String className)
parseTable in class SQLCreateScriptInputst - StringTokernizerclassName - name of the class
protected boolean hasTypeSize(java.lang.String type)
hasTypeSize in class SQLCreateScriptInputtype - to be checked
public java.lang.String getFileExtension()
getFileExtension in interface IInputParserIInputParser.getFileExtension()public java.lang.String getDatabaseName()
IDBInputParser
getDatabaseName in interface IDBInputParserIDBInputParser.getDatabaseName()public java.lang.String getDefaultHost()
IDBInputParser
getDefaultHost in interface IDBInputParserIDBInputParser.getDefaultHost()public int getDefaultPort()
IDBInputParser
getDefaultPort in interface IDBInputParserIDBInputParser.getDefaultPort()public java.lang.String getDefaultUser()
IDBInputParser
getDefaultUser in interface IDBInputParserIDBInputParser.getDefaultUser()public java.lang.String getPassword()
IDBInputParserIDBInputParser.getDefaultUser() that is used for initialization
of the wizard. The password may not be specified in
which case an empty string
is returned. The password must not be null.
getPassword in interface IDBInputParserIDBInputParser.getPassword()public int getRanking()
getRanking in interface IInputParserpublic int getWorkload()
getWorkload in interface IInputParserpublic boolean hasSchema()
hasSchema in interface IDBInputParserprotected boolean isIndexConstraintToken(java.lang.String token)
isIndexConstraintToken in class SQLCreateScriptInputtoken - to be checked
protected boolean isAutogenKey(java.lang.String fieldName,
IDataBaseTable dbt)
isAutogenKey in class SQLCreateScriptInputfieldName - name of the field that is to be checkeddbt - Database table model for with the autogenerated key is searched
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||