Running the tool in Hibernate by R4R Team

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 -cp hibernate_classpaths org.hibernate.tool.hbm2ddl.SchemaExport options mapping_files

In the Below Table SchemaExport Command Line Options are given:

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


Here in the Hibernate we can even embed SchemaExport in your application:

Configuration cfg = ....;
new SchemaExport(cfg).create(false, true);
Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!