[jboss-user] [JBoss Seam] - Re: access the entityManager in a converter (seam 2 beta)

pete.muir@jboss.org do-not-reply at jboss.com
Thu Jun 28 05:57:06 EDT 2007


Easiest way is to use a Seam component


  | @Name("myConverter") @BypassInterceptors @Converter
  | public class MyConverter implements Converter{
  | 
  |    @In EntityManager entityManager;
  |    
  |    @Transactional
  |    public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
  |        entityManager.joinTransaction();
  |        ...
  |    }
  | }

<h:selectOneMenu ... converter="myConverter">

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

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



More information about the jboss-user mailing list