To create the database schema (using create table
SQL commands) we can use the
SchemaManager
tool that comes with JPA
Objects. This is really just a wrapper around Hibernate's
equivalent hbm2ddl tool.
The steps for doing this is described in Section 7.3, “Run the Schema Manager”, but the Maven archetype goes a
little further by setting up some launch configurations for you. Use
and locate the
dba - SchemaManager - create only
launch
configuration. Then . Inspect your database
using the PgAdmin III GUI admin tool (or equivalent
if using your own database); you should see a number of tables created,
as shown below:
For convenience, there are other launch configurations for drop, to recreate or to preview. The last of these, preview, will not hit the database, instead it will just print out the SQL.