Hibernate工具 - DAO生成 [英] Hibernate Tools - DAO generation

查看:159
本文介绍了Hibernate工具 - DAO生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用eclipse hibernate工具插件对我的数据库进行逆向工程。
我花了整整一天的时间寻找如何强制DAO生成器在会话工厂,事务处理等中使用HQL / Criteria。现在,如果我有我的数据库中的表TABLE,我获得了DAO类TableHome。这个类使用持久性EntityManager。



我发现了使用生成TableDAO的旧版本hibernate工具的教程,而这正是我所需要的。



非常感谢。

解决方案

无论您是否使用Eclipse都不清楚,如果是的话,可以检查代码生成模块使用的控制台配置是否未配置为JPA:

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


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.

解决方案

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

这篇关于Hibernate工具 - DAO生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆