JBoss Seam:如何在视图中打开jpa / hibernate会话 [英] JBoss Seam: How to Open jpa/hibernate session in view

查看:183
本文介绍了JBoss Seam:如何在视图中打开jpa / hibernate会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个类似的问题 Spring

但是JBoss Seam怎么样,我需要一个关于我正在开发的应用程序的建议。

But what about JBoss Seam, I need a suggestion regarding the application I am developing.

如果您需要任何特定版本信息,则

If you need any specific version information, they are


  • Seam 2.2

  • JSF 1.2

  • JPA 1和Hibernate作为持久性提供者

推荐答案

查看与持久性上下文相关的seam文档。

Check out the seam documentation related to persistence contexts.

http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html/persistence.html#persistence.seam- managed-persistence-contexts

基本上,你用seam注册持久化上下文并将EntityManager注入你的bean。您可以通过在@Begin注释中设置flushMode(@Begin和@End控制对话),将上下文与对话关联,以使会话在多个请求中保持打开状态。

Essentially, you register the persistence context with seam and inject the EntityManager into your bean. You can associate the context with a conversation to keep the session open across multiple requests by setting the flushMode in the @Begin annotation (@Begin and @End control conversations).

这篇关于JBoss Seam:如何在视图中打开jpa / hibernate会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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