Hibernate Tools - DAO generation

独自空忆成欢 提交于 2019-12-08 05:44:30

问题


I am using the eclipse hibernate tools plug-in to reverse engineer my database. I spent my whole day looking for how to force the DAO generator to use HQL/Criteria with the session factory, transaction, etc.

Right now, if I have the table TABLE in my database, I obtain the DAO class TableHome. This class uses the persistence EntityManager.

I found tutorials using an older version of hibernate tools generating TableDAO instead, and this is what I exactly need.

Thank you very much.


回答1:


Whether you're using Eclipse or not is unclear but if you are, maybe check if the Console Configuration used by the Code Generation module is not configured for JPA:

alt text http://docs.jboss.org/tools/2.1.0.Beta1/hibernatetools/html/images/plugins/plugins_2.png

See also

  • Section 3.4. Creating a Hibernate Console Configuration
  • Section 3.5. Reverse Engineering and Code Generation



回答2:


Use Salto-DB Eclipse plugin. It comes with all the stuff.



来源:https://stackoverflow.com/questions/2952807/hibernate-tools-dao-generation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!