DataBaseGen

This tool probably belongs in its own maven sub-project, because although it is useful for the TCK in order to generate DDL for tests, it is a useful end-user tool in its own right.

The tool consists of a Main class that can be run as a command-line tool to create DDL for a set of persistent classes and a class that Main delegates to after processing the command line and system properties. The delegate can be invoked from other application or system components (e.g. the deployer in a J2EE server).

Input to the tool comes from three sources: one or more .jdo files that describe the persistent classes, one or more .class files that contain the byte-codes for the classes, one or more .orm files that describe the mapping, a policy file that governs the generation of DDL specific to a database, and user overrides for generic or specific mappings.

The output is one or more files that contain the DDL to drop and create the schema entries (tables, columns, and constraints).

The command line identifies the classes that will be used to generate DDL and options for the generation.

java <java-options> org.apache.jdo.gen.DDLGen <ddlgen-options> <classes>

java-options:

-D<key>=<value> provides specific overrides as command line parameters

ddlgen-options:

classes:

enumeration of classes for which to generate DDL, either in com.acme.Employee or com/acme/Employee.class format if no classes are listed, all classes contained in the META-INF/package.jdo and WEB-INF/package.jdo are assumed

example:

This command is issued where the working directory contains the hr.jar and into which generates hr-create.ddl, and hr-drop.ddl.

java org.apache.jdo.gen.DDLGen -vv -s hr.jar -oc hr-create.ddl -od hr-drop.ddl -p Oracle.policy -q oracle

DataBaseGen (last edited 2009-09-20 23:08:54 by localhost)