20.2.3. Running the Tool


The SchemaExport tool writes a DDL script to standard out and/or executes the DDL statements.
The following table displays the SchemaExport command line options
java -cphibernate_classpathsorg.hibernate.tool.hbm2ddl.SchemaExport options mapping_files
Table 20.2. SchemaExport Command Line Options
Option Description
--quiet do not output the script to stdout
--drop only drop the tables
--create only create the tables
--text do not export to the database
--output=my_schema.ddl output the ddl script to a file
--naming=eg.MyNamingStrategy select a NamingStrategy
--config=hibernate.cfg.xml read Hibernate configuration from an XML file
--properties=hibernate.properties read database properties from a file
--format format the generated SQL nicely in the script
--delimiter=; set an end of line delimiter for the script
You can even embed SchemaExport in your application:
Configuration cfg = ....;
new SchemaExport(cfg).create(false, true);
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.