net.sf.colle.sql.schema
Class TableBuilder

java.lang.Object
  extended bynet.sf.colle.sql.schema.TableBuilder

public class TableBuilder
extends Object

Command line utility for building SQL tables. Created: 14 Feb 2001

Version:
$Revision: 1.9 $, $Date: 2004/09/13 05:07:30 $
Author:
Dwayne Schultz

Constructor Summary
TableBuilder()
          Constructs a new table builder with the model and data directories set by system properties.
TableBuilder(File pxModelDirectory, File pxDataDirectory, boolean pbUseNativeLoader, Connection pxConnection)
          Constructs a new table builder with the specified model and data directories.
 
Method Summary
 void appendLoaderFilter(LoaderFilter pxLoaderFilter)
           
 void build(String psCommand)
           
 void build(String psCommand, String psTable)
           
 void build(String psCommand, String psTable, File pxCSVFile)
           
 void create(String psTable)
          Creates the table specified.
 void createAll()
          Create all the tables.
 void drop(String psTable)
          Drops the table specified.
 void dropAll()
          Drop all the tables.
 Connection getConnection()
           
 DateFormat getDateFormat()
           
 NumberFormat getDoubleFormat()
           
 int getInsertsPerCommit()
           
 NumberFormat getIntFormat()
           
 List getLoaderFilters()
           
 boolean getUseNativeLoader()
           
 void index(String psTable)
          Indexes the table specified.
 void indexAll()
          Index all the tables.
 void indexAllForeign()
          Index foreign keys of all the tables.
 void indexForeign(String psTable)
          Indexes foreign keys in the table specified.
 void load(String psTable)
          Loads the table specified from the csv file with the same name.
 void load(String psTable, File pxFile)
          Loads the table specified from the file specified.
 void loadAll()
          Load all the tables.
static void main(String[] pxArgs)
          Command line interface.
 void sequence(String psTable)
          Indexes the table specified.
 void sequenceAll()
          Sequence all the tables.
 void setConnection(Connection pxConnection)
           
 void setDateFormat(DateFormat pxDateFormat)
           
 void setDoubleFormat(NumberFormat pxDoubleFormat)
           
 void setInsertsPerCommit(int pnInsertsPerCommit)
           
 void setIntFormat(NumberFormat pxIntFormat)
           
static void usage()
          Outputs command line usage to standard out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableBuilder

public TableBuilder()
Constructs a new table builder with the model and data directories set by system properties. This default constructor is used by the command line entry point and uses several defaults and system properties.


TableBuilder

public TableBuilder(File pxModelDirectory,
                    File pxDataDirectory,
                    boolean pbUseNativeLoader,
                    Connection pxConnection)
Constructs a new table builder with the specified model and data directories.

Method Detail

getUseNativeLoader

public boolean getUseNativeLoader()

getLoaderFilters

public List getLoaderFilters()

appendLoaderFilter

public final void appendLoaderFilter(LoaderFilter pxLoaderFilter)

getDateFormat

public DateFormat getDateFormat()

setDateFormat

public void setDateFormat(DateFormat pxDateFormat)

getDoubleFormat

public NumberFormat getDoubleFormat()

setDoubleFormat

public void setDoubleFormat(NumberFormat pxDoubleFormat)

getIntFormat

public NumberFormat getIntFormat()

setIntFormat

public void setIntFormat(NumberFormat pxIntFormat)

getInsertsPerCommit

public int getInsertsPerCommit()

setInsertsPerCommit

public void setInsertsPerCommit(int pnInsertsPerCommit)

getConnection

public Connection getConnection()

setConnection

public void setConnection(Connection pxConnection)

main

public static void main(String[] pxArgs)
Command line interface.

Parameters:
pxArgs - command line arguments @see #usage().

usage

public static void usage()
Outputs command line usage to standard out.


build

public void build(String psCommand)
           throws UnsupportedOperationException
Throws:
UnsupportedOperationException

build

public void build(String psCommand,
                  String psTable)
           throws UnsupportedOperationException
Throws:
UnsupportedOperationException

build

public void build(String psCommand,
                  String psTable,
                  File pxCSVFile)

createAll

public void createAll()
Create all the tables.


dropAll

public void dropAll()
Drop all the tables.


loadAll

public void loadAll()
Load all the tables.


indexAll

public void indexAll()
Index all the tables.


sequenceAll

public void sequenceAll()
Sequence all the tables.


indexAllForeign

public void indexAllForeign()
Index foreign keys of all the tables.


create

public void create(String psTable)
Creates the table specified.


load

public void load(String psTable)
Loads the table specified from the csv file with the same name.


load

public void load(String psTable,
                 File pxFile)
Loads the table specified from the file specified.


index

public void index(String psTable)
Indexes the table specified.


indexForeign

public void indexForeign(String psTable)
Indexes foreign keys in the table specified.


sequence

public void sequence(String psTable)
Indexes the table specified.


drop

public void drop(String psTable)
Drops the table specified. The table may not be in the current schema.