0 Replies Latest reply on Nov 25, 2014 12:02 PM by ivanlch08

    @Stateful and @Name combined in Seam

    ivanlch08

      Hello,

       

      I get confused about put both annotations on one class, I'm in a project where most classes are that way.

       

      //SEAM COMPONENT AND EJB

      @Stateful

      @Name("javaBean")

      @Scope(ScopeType.CONVERSATION)

      public class JavaBean implements JavaBeanLocal {... }

       

      Personally, I would do it different, by having separate the Seam component and the EJB, and then, the Seam component inject the EJB:

       

      //SEAM COMPONENT

      @Name("javaBean")

      @Scope(ScopeType.CONVERSATION)

      public class JavaBean {

      //INJECT EJB

      @EJB

      private JavaEJBLocal javaEJB;

      }

       

      //EJB

      @Stateful

      public class JavaEJB implements JavaEJBLocal {... }

       

      My question is which way is correct? combine both annotations can give scope errors, or any kind of error?

       

      Thanks for you comments and sorry for my english.