任何人都可以推荐使用Eclipse设置Hibernate3的好参考? [英] Can anyone recommend a good reference for setting up Hibernate3 with Eclipse?

查看:98
本文介绍了任何人都可以推荐使用Eclipse设置Hibernate3的好参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看了一些Eclipse和Hibernate教程,而Hibernate2的教程很好,很直观。最近我试图使用Eclipse插件来设置Hibernate3,并且无法让Hibernate工具工作,除了将jar文件从plugins目录移动到我的lib目录之外(我不应该这样做!)

I've looked at some of the Eclipse and Hibernate tutorials and the ones for Hibernate2 are pretty good, pretty intuitive. Recently I tried to setup Hibernate3, using the Eclipse plugin, and failed to get the Hibernate tools to work, outside of physically moving the jar files from the plugins directory to my lib directory (I shouldn't have to do this!)

推荐答案

我不知道你是否仍然需要回答你的问题,但是我们自己的stackoverflow网站可能是您要查找的解决方案

I'm not sure if you are still needing an answer to your question, but our very own stackoverflow website has probably the solution you are looking for.

如果没有完全回答你的问题,那么这可能是诀窍: Hibernate和Eclipse集成

If that doesn't fully answer your question, then this might do the trick : "Hibernate and Eclipse Integration.

从链接的Hibernate网站:

from the linked Hibernate website:



Hibernate插件的MANIFEST.MF文件(其中需要
好​​友加载),如
org.hibernate.eclipse,添加一行:

In the MANIFEST.MF file of the Hibernate plugin (which NEEDS the buddy loading), such as org.hibernate.eclipse, add a line:

Eclipse-BuddyPolicy:注册

Eclipse-BuddyPolicy:registered

,并在
插件项目或RCP项目的MANIFEST.MF文件中添加
line:

and in the MANIFEST.MF file of your plugin project or RCP project, add the line:

Eclipse-RegisterBuddy:org.hibernate.eclipse

Eclipse-RegisterBuddy:org.hibernate.eclipse

重要的是注意语法 - 我们
插件愿意被
hibernate库看到,使用
Eclipse-RegisterBuddy,Hibernate
正在注册
Eclipse-BuddyPolicy。虽然这是
在Eclipse帮助(
回顾!)中明确指出,但是非常重要的是要获得
语法的正确性。

Important to notice the syntax - our plugin is willing to be seen by the hibernate library, using Eclipse-RegisterBuddy, and Hibernate is registering itself with Eclipse-BuddyPolicy. While this is stated clearly in the Eclipse Help (in retrospect!) it is critical to get the syntax precisely correct.

最后,如果你使用
HibernateUtil作为你的主要入口点
进入Hibernate,那么在你的插件
start方法添加行:

Finally, if you are using HibernateUtil as your main entry point into Hibernate, then in your plugin start method add the line:

的Class.forName( myPlugin.HibernateUtil);
//完整的类名应该去这里

Class.forName("myPlugin.HibernateUtil"); //full class name should go here

这个工作 - 假设是
hibernate.cfg.xml在src
你的插件的目录,这是
在类路径。

This works - assumption is that hibernate.cfg.xml is in the src directory of your plugin and this is in the classpath.

希望这可以帮助你。

这篇关于任何人都可以推荐使用Eclipse设置Hibernate3的好参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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