I have a question:
I have statefull bean:
@Stateful @Scope(ScopeType.SESSION) @Name("hotelSearch") public class HotelSearch implements HotelSearchLocalIF { @DataModelSelection private Hotel hotel; @DataModel private List<Hotel> hotelList; /** * Set new hotel. */ public void setHotel(Hotel hotel) { this.hotel = hotel; } private void logHotel() { log.debug(this.hotel); } }
hotel.setHotel(newHotel)from another stateless bean to set new detail.
logHotel()but there is original hotel logged
setHote(hotel)sets new detail only for
setHotel()method duration. But after this method ends, original hotel is injected.
public void setHotel(Hotel hotel) { // this.hotel = hotel; //not works, after methodends, there is original hotel injected //ne approach to update hotel detail this.hotel.setId(hotel.getId); this.hotel.setName(hotel.getName); ... }