春天 +休眠+日本PA
到目前为止,我已经有了一个可以持久运行的 Spring 应用程序。但是现在我想使用 Hibernate 和 JPA 来完成所有数据库活动。我想使用实体管理器来做到这一点。
我已经阅读了很多关于这个问题的文档和教程,我一直对是否需要 persistence.xml 文件感到困惑。另外,我也对如何设置 applicationContext.xml 文件感到困惑。
有谁知道有什么好的网站可以用来学习 Spring + Hibernate + JPA + 使用 EntityManager 吗?
As of now I have a working Spring application with persistence. However now I want to use Hibernate with JPA to do all of my database activities. I want to do this using an entitymanager.
I've been reading many documents and tutorials on this matter, I've been getting confused on whether I need a persistence.xml file or not. Also I've been getting confused on how to setup my applicationContext.xml file as well.
Does anybody know of a good site to look at in order to learn Spring + Hibernate + JPA + using EntityManager?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
过去几周我一直在尝试建立同样类型的项目。
您确实需要一个 persistence.xml 文件,它属于 META-INF 下面
是我用于持久性的 spring beans 文件的示例:
另外,我使用 Maven 来引入我需要的 spring3 和 hibernate 依赖项。
编辑:对于学习资源,我强烈推荐 Gary Mac 的“Spring Recipes A Problem-Solution Approach” http: //www.apress.com/book/view/9781590599792。这是我读过的最好的技术书籍之一,它肯定会帮助您入门并运行 Spring/JPA/Hibernate。
I've just spent the last couple of weeks trying to set up the same kind of project.
You do need a persistence.xml file, and it belongs in META-INF
Here is an example of my spring beans file for persistence:
Also, I am using Maven to pull in the spring3 and hibernate dependencies i need.
edit: for a learning resource I highly recommend "Spring Recipes A Problem-Solution Approach" by Gary Mac http://www.apress.com/book/view/9781590599792. This is one of the best technical books I've ever read, and it will surely help you get up and running with Spring/JPA/Hibernate.