Keel 2.1RC2

org.keel.models.util
Class CreateDBSchema

java.lang.Object
  extended byorg.keel.services.model.StandardModel
      extended byorg.keel.services.model.StandardLogEnabledModel
          extended byorg.keel.services.model.SecurableStandardLogEnabledModel
              extended byorg.keel.models.util.CreateDBSchema
All Implemented Interfaces:
Configurable, Contextualizable, LogEnabled, Model, Securable

public class CreateDBSchema
extends SecurableStandardLogEnabledModel
implements Contextualizable

Author:
Santanu Dutt Company:PlatinumSolutions Inc. This model is helper class which reverse engineers an existing database to generate the XML schema file. To run it one has to use the command line user interface Keel.java in the org.keel.clients.cli package. (To obtain help in running Keel.java, run the program and type in "help" in the command prompt for help) This program requires two parameters which are optional. They are- schemaName -- name of the schema root node( normally it is the application name) schemaDir -- name of the directory where the schema.xml file will be created. If schemaDir is not provided then the content of the schema is written to the System.out(). Remember that the schema.xml file is created from the information that can be gathered about a table from the DataBaseMetaData information obtained based on the jdbc package used. Things like ValidValues, Auto-increment, etc. for a field have to be manually added.

Field Summary
private  Context context
           
 
Fields inherited from class org.keel.services.model.SecurableStandardLogEnabledModel
 
Fields inherited from class org.keel.services.model.StandardLogEnabledModel
log
 
Fields inherited from class org.keel.services.model.StandardModel
configuration
 
Fields inherited from interface org.keel.services.model.Model
ROLE
 
Constructor Summary
CreateDBSchema()
           
 
Method Summary
 void contextualize(Context context)
          Pass the Context to the component.
 ModelResponse execute(ModelRequest req)
           
 org.w3c.dom.Document generateDocument(java.sql.Connection myConnection, java.lang.String dataBaseType, java.lang.String schemaPattern, java.lang.String tableNamePattern)
           
private static void genTableSchema(org.w3c.dom.Document dbschemadoc, java.sql.Connection myConnection, java.lang.String tableName, java.lang.String desc, java.lang.String dataBaseType)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class org.keel.services.model.SecurableStandardLogEnabledModel
getAuthorizationManager, setAuthorizationManager
 
Methods inherited from class org.keel.services.model.StandardLogEnabledModel
enableLogging
 
Methods inherited from class org.keel.services.model.StandardModel
configure, getConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

private Context context
Constructor Detail

CreateDBSchema

public CreateDBSchema()
Method Detail

generateDocument

public org.w3c.dom.Document generateDocument(java.sql.Connection myConnection,
                                             java.lang.String dataBaseType,
                                             java.lang.String schemaPattern,
                                             java.lang.String tableNamePattern)
                                      throws javax.xml.parsers.ParserConfigurationException,
                                             java.sql.SQLException
Throws:
javax.xml.parsers.ParserConfigurationException
java.sql.SQLException

execute

public ModelResponse execute(ModelRequest req)
                      throws ModelException
Specified by:
execute in interface Model
Throws:
ModelException

genTableSchema

private static void genTableSchema(org.w3c.dom.Document dbschemadoc,
                                   java.sql.Connection myConnection,
                                   java.lang.String tableName,
                                   java.lang.String desc,
                                   java.lang.String dataBaseType)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

main

public static void main(java.lang.String[] args)

contextualize

public void contextualize(Context context)
                   throws ContextException
Description copied from interface: Contextualizable
Pass the Context to the component. This method is called after the Loggable.setLogger() (if present) method and before any other method.

Specified by:
contextualize in interface Contextualizable
Parameters:
context - the context. Must not be null.
Throws:
ContextException - if context is invalid

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.