1 Reply Latest reply on May 19, 2009 7:39 AM by Gavin King

    class level and method level scoping

    Arbi Sookazian Master

      So there is the following code sample in the Yuan et al 2nd ed. book:


      @Named
      @ConversationScoped
      @Production
      @Stateful
      public class HotelSearchingAction implements HotelSearching {
         private String search;
         
         @Produces @ConversationScoped @Named("hotels")
         public List<Hotel> queryHotels(){
         ...
         }
      }



      Is the @ConversationScoped annotation required for queryHotels()?  Will it not default to @ConversationScoped because the class is @ConversationScoped?


      Also, isn't 299 part of EE 6 which includes EJB 3.1?  And EJB 3.1 does not require local interfaces?  So why does this class (which is an EJB) implement an interface which is most likely just an optional local interface?


      BTW: I can't wait until the next idiom/technology replaces XML and annotations.  metadata will most likely never go away but either way it's ugly/messy nowadays...