0 Replies Latest reply on Apr 24, 2010 6:44 AM by Vlad Tepes

    Weld - passing parameters

    Vlad Tepes Newbie

      Hi, I have a method which gets an entity from db. It's a standart method

       

      public EntityBean find(int id) {
          entityManager.find(EntityBean, id);
      }

       

       

       

      I'd like to use the @Produces annotation, something like this:

       

      @Produces
      @MyAnnotation
      public EntityBean find(int id) {
          entityManager.find(EntityBean, id);
      }

       

      and in a JSF managef bean

       

      @Inject @MyAnnotation EntityBean eb;

       

      but i don't know how to pass the id to the method. Is it possible? How to do this?

       

      Thanks for any help.

       

      P.S. Sorry if it's the wrong forum for this post.