2 Replies Latest reply on Feb 5, 2007 11:22 AM by Norman Richards

    @Factory

    Gregory Nikle Apprentice

      Hi,
      Is any posible to use one method to fill 2 collections by using @Factory,
      somethink like:
      List firstList;
      List secondList;

      @Factory("firstList","secondList")
      public void fillAll() {
      ....
      }
      Regards

        • 1. Re: @Factory
          None None Master

          @Factory cannot take more than one argument. I asked a question just now about having multiple @Factory methods in a SFSB. I couldn't see anything in the docs that mention that, but I looked in the Seam examples and there weren't any classes there that had more than one Factory in them, so I don't know if it's a good idea or not.

          For what you are trying to do (have a FillAll method), why not do that in your @Begin method?

          • 2. Re: @Factory
            Norman Richards Master

            You can not have duplicate annotations on a method. The normal annotations way to deal with this would be with @Factories(), but that starts to look fairly ugly.