0 Replies Latest reply on Jul 26, 2007 10:32 AM by francof

    Newbie question

      Trying to understand @Out


      I have this code

      @Out(required=true)
      private List catalogs;

      @Factory
      @SuppressWarnings("unchecked")
      public void getCatalogs() {
      catalogs = em.createQuery("select catalog from Catalog catalog").getResultList();
      }


      The documentation I read says that if I have a factory method operating on my field catalogs, it should be annotated with
      @Out(required=false)

      My code still works, so I can't understand the difference.
      Annotation help for required on @Out says
      "Specifies that the outjected value must not be null, by default."

      Not getting it here, does that mean if the value is null, a new object of that type will be created ?

      Also not real sure of use of Factory methods. Let's say when User A first hits the page, the factory method would populate the list. User B is also making changes on this page, how will user A see these changes if factory method is called only once. Should I program instead an init method using page.xml ?



      Thanks in advance