このコンテンツは選択した言語では利用できません。
20.2.8. Schema Validation
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_classpathsorg.hibernate.tool.hbm2ddl.SchemaValidator
options mapping_files
The following table displays the
SchemaValidator
command line options:
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 |
You can embed
SchemaValidator
in your application:
Configuration cfg = ....; new SchemaValidator(cfg).validate();
Configuration cfg = ....;
new SchemaValidator(cfg).validate();