no pasa por el preUpdate de booking ni con los Home ni con el entityManager
código de la prueba (action1.java)
package org.domain.test11.session;
import javax.persistence.EntityManager;
import org.domain.test11.entity.Booking;
import org.domain.test11.entity.Hotel;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.international.StatusMessages;
import org.jboss.seam.log.Log;
@Name("action1")
public class Action1
{
@Logger private Log log;
@In StatusMessages statusMessages;
@In(create=true) BookingHome bookingHome;
@In(create=true) HotelHome hotelHome;
public void action1()
{
// implement your business logic here
log.info("action1.action1() action called");
statusMessages.add("action1");
update3();
}
@In EntityManager entityManager;
public void update2() {
Booking b = (Booking)entityManager.find(Booking.class, new Long(1));
b.getCustomer().setName("pepero");
entityManager.persist(b);
}
public void update3() {
Hotel hotel = hotelHome.getEntityManager().find(Hotel.class, new Long(1));
Booking booking = bookingHome.getEntityManager().find(Booking.class, new Long(1));
booking.getHotel().setCity("madrid3");
booking.getCustomer().setName("manolo6");
bookingHome.setInstance(booking);
bookingHome.update();
}
// add additional action methods
}
No hay comentarios:
Publicar un comentario