[jboss-user] [JBoss Seam] - Booking example question

lawrieg do-not-reply at jboss.com
Mon Feb 19 05:12:45 EST 2007


I've just been re-reading the Seam tutorial and I just wanted to check if my understanding is correct regarding the Booking example code...

In the HotelBookingAction class the selectHotel method reads as follows:

  | public String selectHotel(Hotel selectedHotel) {
  |     hotel = em.merge(selectedHotel);
  |     return "hotel";
  | }

Am I correct that the reason the line hotel = em.merge(selectedHotel) is necessary is because the selectedHotel object was obtained by a different entity manager?

And, if so, does this mean that you always need to use em.merge when an object that was loaded in one class is passed as a parameter to a method in another class? 



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018730#4018730

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018730

More information about the jboss-user mailing list