To create the database schema (using create table
SQL commands) we can use the schema manager tool
(org.starobjects.jpa.tools.SchemaManager
) that
comes with JPA Objects. This is really just a
wrapper around Hibernate's equivalent hbm2ddl tool.
It takes the following arguments:
-g <config directory containing nakedobjects.properties>
Depending on where you run the utility from, this is typically
something like ../commandline/config
. This is
read for the repositories, from which the Naked Objects and
Hibernate metamodels are built up. After that, the hbm2ddl utility
is run.
-c
create database, no initial drop. If omitted will do a drop followed by create (ie a recreate)
-d
drop database, no initial create. If omitted will do a drop followed by create (ie a recreate)
-x
execute. If omitted, then does nothing, ie just previews the commands by writing to stdout