[jboss-user] [JBoss Seam] - Re: Can Seam work with no ejb3 but with Hibernate ORM?

gavin.king@jboss.com do-not-reply at jboss.com
Wed Dec 13 15:33:40 EST 2006


It sounds like the problem you are trying to solve is:

"how can I have my DAOs use the Seam-managed persistence context when running inside the context of Seam, but use some other method of persistence context management outside of Seam"

And I guess you also want to be able to inject your DAOs into Seam components.

Probably the easiest way is to declare them in components.xml, and let Seam inject the Session that way:


<component name="customerDao" class="com.mydomain.myapp.CustomerDao">
  |     <property name="session">#{mySession}</property>
  | </component>

Then your DAO's getSession() method can check if the session has been injected, and return that one if it has been, otherwise use your current mechanism to look up a session from Hibernate.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993584#3993584

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993584



More information about the jboss-user mailing list