简体   繁体   English

休眠工具-DAO生成

[英]Hibernate Tools - DAO generation

I am using the eclipse hibernate tools plug-in to reverse engineer my database. 我正在使用eclipse休眠工具插件对我的数据库进行反向工程。 I spent my whole day looking for how to force the DAO generator to use HQL/Criteria with the session factory, transaction, etc. 我一整天都在寻找如何强制DAO生成器在会话工厂,事务等中使用HQL /条件。

Right now, if I have the table TABLE in my database, I obtain the DAO class TableHome. 现在,如果我的数据库中有表TABLE,则将获得DAO类TableHome。 This class uses the persistence EntityManager. 此类使用持久性EntityManager。

I found tutorials using an older version of hibernate tools generating TableDAO instead, and this is what I exactly need. 我找到了使用较旧版本的休眠工具生成TableDAO的教程,而这正是我真正需要的。

Thank you very much. 非常感谢你。

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: 不清楚是否使用Eclipse,但是如果使用,则可能要检查是否未为JPA配置“ 代码生成”模块使用的控制台配置

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

See also 也可以看看

Use Salto-DB Eclipse plugin. 使用Salto-DB Eclipse插件。 It comes with all the stuff. 它包含所有东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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