Hibernate SchemaExport command line -



Hibernate SchemaExport command line -

i found documentation http://docs.jboss.org/hibernate/core/4.0/manual/en-us/html/toolsetguide.html#toolsetguide-s1-3 saying can run schemaexport using command line

java -cp hibernate_classpaths org.hibernate.tool.hbm2ddl.schemaexport options mapping_files

can please provide illustration of how used? format of classpath (perhaps illustration classpath), how do hbm.xml mapping?

thanks

not problem :) example:

java -cp "hibernate/*" org.hibernate.tool.hbm2ddl.schemaexport --properties=hibernate.properties --text person.hbm.xml user.hbm.xml

here "hibernate/*" means have folder named "hibernate" libraries hibernate (incl. hibernate3 of course).

in case:

antlr-2.7.6.jar cglib-2.2.jar commons-collections-3.1.jar dom4j-1.6.1.jar hibernate-testing.jar hibernate3.jar javassist-3.9.0.ga.jar jta-1.1.jar log4j-1.2.16.jar slf4j-api-1.5.8.jar slf4j-log4j12-1.6.1.jar

you have set in current folder file hibernate.properties (you can utilize hibernate.cfg.xml, alternative --config instead of --properties. i.e. "--config=hibernate.cfg.xml")

--text - output console next list of necessary files *.hbm.xml.

that's all.

hibernate

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -