org.jcoderz.testdata
Class Importer

java.lang.Object
  extended by org.jcoderz.testdata.Importer

public class Importer
extends Object

Generic Test data importer. Recursively scans a directory for test data items and submits them via JDBC to a predefined database. The tables and attribute names are mapped straightforward to the hibernate configuration expected on the classpath. This implementation relies on auto index of all tables.

Author:
Torsten Stolpmann

Constructor Summary
Importer(String prefix, long base)
           
 
Method Summary
protected  String getAsPrimaryKey(String id)
          Gets the supplied id as a primary key representation.
protected  String getTableName(nu.xom.Document item)
          Returns the table name for the given item.
static void main(String[] args)
          The main method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Importer

public Importer(String prefix,
                long base)
Method Detail

main

public static void main(String[] args)
The main method.

Parameters:
args - Command line arguments.

getAsPrimaryKey

protected String getAsPrimaryKey(String id)
Gets the supplied id as a primary key representation.

Parameters:
id - the id
Returns:
the primary key

getTableName

protected String getTableName(nu.xom.Document item)
Returns the table name for the given item.

Parameters:
item - the item
Returns:
the table name


Copyright 2007 The jCoderZ Project.