Schema validation in Hibernate by R4R Team

The SchemaValidator tool will validate that the existing database schema "matches" your mapping documents. The SchemaValidator depends heavily upon the JDBC metadata API and, as such, will not work with all JDBC drivers. This tool is extremely useful for testing. java -cp hibernate_classpaths org.hibernate.tool.hbm2ddl.SchemaValidator options mapping_files

By the help of the below Table of SchemaValidator Command Line Options is given:

Option

Description

--naming=eg.MyNamingStrategy

select a NamingStrategy

--properties=hibernate.properties

read database properties from a file

--config=hibernate.cfg.xml

specify a .cfg.xml file


We can embed SchemaValidator in application as code is given below:

Configuration cfg = ....;
new SchemaValidator(cfg).validate();
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!