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。 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章