简体   繁体   中英

Distributing a persistance class that uses Hibernate

So I have a standalone application and a web application to do, but the persistance classes that I've created in the standalone gonna be used in the web application too. Since my standalone project have the hibernate.cfg.xml and the hbm.xml for each persistance class, how can I export this project like in a JAR and just import in the web application project and use the classes easily?

Use maven to create a jar containing persistence classes and *.hbm.xml files. In your webapp you can use this jar as a dependency and use the hbm files to configure your session factory bean.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM