ch.sahits.codegen.model
Interface IBasicDBConnectionModelGenerator

All Known Subinterfaces:
IDBConnectionModelGenerator, IGeneralDBConnectionModelGenerator
All Known Implementing Classes:
MySQLConnectionModelGenerator, OracleConnectorModelGenerator, SQLServerConnectionModelGenerator

public interface IBasicDBConnectionModelGenerator

This interface defines the basic functionality that is needed to generate a DataBaseTable from a connection. This interface should not be implemented directly but through subinterfaces that add an appropriate init method.

Since:
0.9.0
Author:
Andi Hotz

Method Summary
 DataBaseTable generateModel()
          Generate the model from the connection
 java.lang.String getConnectionDriverClass()
          Retrieve the driver class name for the JDBC connection
 java.lang.String getConnectionString()
          Retrieve the connection String for the specific database
 java.lang.String getDefaultHost()
          Retrieve the default name of the database host
 java.lang.String getDefaultPort()
          Retrieve the default port number of the data base
 java.lang.String getDefaultUserName()
          Retrieve the default user name for the data base
 int getRating()
          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
 void setDatabase(java.lang.String dbName)
          Set the name of the database
 void setHost(java.lang.String host)
          Set the name of the database host
 void setPassword(java.lang.String pwd)
          Set the password for the database user
 void setPort(int port)
          Set the port number of the database
 void setTableName(java.lang.String tableName)
          Set the name of the table
 void setUserName(java.lang.String userName)
          Set the name of the database user
 java.lang.String testConnection()
          Test the connection to the database.
 

Method Detail

testConnection

java.lang.String testConnection()
Test the connection to the database.

Returns:
Error message if the test failed or null

generateModel

DataBaseTable generateModel()
Generate the model from the connection

Returns:
generated model

setHost

void setHost(java.lang.String host)
Set the name of the database host

Parameters:
host - name of the host

setPort

void setPort(int port)
Set the port number of the database

Parameters:
port - number

setUserName

void setUserName(java.lang.String userName)
Set the name of the database user

Parameters:
userName - name of the user

setPassword

void setPassword(java.lang.String pwd)
Set the password for the database user

Parameters:
pwd - password

setDatabase

void setDatabase(java.lang.String dbName)
Set the name of the database

Parameters:
dbName - database name

setTableName

void setTableName(java.lang.String tableName)
Set the name of the table

Parameters:
tableName - table name

getDefaultHost

java.lang.String getDefaultHost()
Retrieve the default name of the database host

Returns:
host name

getDefaultPort

java.lang.String getDefaultPort()
Retrieve the default port number of the data base

Returns:
port number

getDefaultUserName

java.lang.String getDefaultUserName()
Retrieve the default user name for the data base

Returns:
user name

getRating

int getRating()
This method rates the implementation. Since this Interface is used for an extension point Implementations with the highest ranking are choosen

Returns:
Ranking for the implementation

getWorkload

int getWorkload()
Defines how complex the generation of the model is

Returns:
Number of work steps

hasSchema

boolean hasSchema()
Indicates if this database works through schemas

Returns:
true if the schema must be supplied.

getConnectionString

java.lang.String getConnectionString()
Retrieve the connection String for the specific database

Returns:
connection string
Since:
1.2.0

getConnectionDriverClass

java.lang.String getConnectionDriverClass()
Retrieve the driver class name for the JDBC connection

Returns:
fully qualified driver class name
Since:
1.2.0