Hibernate Tools

hibernate tools input and output

使用HIBERNATE 工具的几个情形:
1. 已经写好了JAVA类,还没设计数据库,这时可以先编写好HIBERNATE的MAP,再用hbm2ddl生成数据库。
2 已经写好了数据库,没有JAVA类,In this case, the easiest way to proceed is to use the reverse-engineering tools to extract metadata from the database. This metadata can be used to generate XML mapping files, with hbm2hbmxml for example. With hbm2java, the Hibernate mapping metadata is used to generate Java persistent classes, and even data access objects。
3 已经写好MAPPING,没有数据库和JAVA类。some architects and developers prefer middle-out development, where they begin with handwritten Hibernate XML mapping files, and then generate the database schema using hbm2ddl and Java classes using hbm2java.
4 已经存在JAVA类和数据库,这时很难使用HIBERNATE  工具了。只能够手工写MAPPING。 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章