SRJRCFrames
v0.1.296

de.schwarzrot.data.access.jdbc
Class JDBCModelCreator

java.lang.Object
  extended by de.schwarzrot.data.access.jdbc.JDBCModelCreator

public class JDBCModelCreator
extends Object

class to ease database model creation. It may either be used to create build-scripts for certain database, or create the model directly via JDBC. It uses DbUtil implementations to hide the database implementation specific stuff, so it should work with other databases too.

Playing together with XMLExporter and XMLImporter it is a powerful weapon to port database schema.

Author:
Reinhard Mantey

Constructor Summary
JDBCModelCreator(Connection conn)
           
JDBCModelCreator(Connection conn, boolean removeBeforeCreation)
           
JDBCModelCreator(Connection conn, ProgressTracker tracker)
           
JDBCModelCreator(Connection conn, ProgressTracker tracker, boolean removeBeforeCreation)
           
 
Method Summary
 void create(DatabaseModel dbInfo)
          creates a database model directly via JDBC
protected  void createIndices(TableDefinition ti)
           
protected  void createTables(SchemaDefinition schemInfo)
           
 void generate(DatabaseModel dbInfo, File target)
          creates build-script usable for certain database.
protected  void generateAccessRights(TableDefinition ti, Writer out, String defaultUser)
           
protected  void generateDBCreation(DatabaseModel dbInfo, Writer out)
           
protected  void generateIndexCreation(TableDefinition ti, Writer out)
           
protected  void generateSchemaCreation(DatabaseModel dbInfo, Writer out)
           
protected  void generateTableCreation(SchemaDefinition schemInfo, Writer out)
           
protected  void grantRights(TableDefinition ti, String defaultUser)
           
 void remove(DatabaseModel dbInfo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCModelCreator

public JDBCModelCreator(Connection conn)

JDBCModelCreator

public JDBCModelCreator(Connection conn,
                        boolean removeBeforeCreation)

JDBCModelCreator

public JDBCModelCreator(Connection conn,
                        ProgressTracker tracker)

JDBCModelCreator

public JDBCModelCreator(Connection conn,
                        ProgressTracker tracker,
                        boolean removeBeforeCreation)
Method Detail

create

public void create(DatabaseModel dbInfo)
creates a database model directly via JDBC

Parameters:
dbInfo - the model definition

generate

public void generate(DatabaseModel dbInfo,
                     File target)
              throws IOException
creates build-script usable for certain database. Database is selected from the active datasource configuration.

Parameters:
dbInfo - the model definition
target - the name of the script file
Throws:
IOException - - just let the exception from underlying layers pass to application

remove

public void remove(DatabaseModel dbInfo)

createIndices

protected void createIndices(TableDefinition ti)

createTables

protected void createTables(SchemaDefinition schemInfo)

generateAccessRights

protected void generateAccessRights(TableDefinition ti,
                                    Writer out,
                                    String defaultUser)
                             throws IOException
Throws:
IOException

generateDBCreation

protected void generateDBCreation(DatabaseModel dbInfo,
                                  Writer out)
                           throws IOException
Throws:
IOException

generateIndexCreation

protected void generateIndexCreation(TableDefinition ti,
                                     Writer out)
                              throws IOException
Throws:
IOException

generateSchemaCreation

protected void generateSchemaCreation(DatabaseModel dbInfo,
                                      Writer out)
                               throws IOException
Throws:
IOException

generateTableCreation

protected void generateTableCreation(SchemaDefinition schemInfo,
                                     Writer out)
                              throws IOException
Throws:
IOException

grantRights

protected void grantRights(TableDefinition ti,
                           String defaultUser)

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.