Ver Mensaje Individual
  #6 (permalink)  
Antiguo 13/12/2013, 02:02
Avatar de rgf1987
rgf1987
 
Fecha de Ingreso: diciembre-2012
Ubicación: Asturias
Mensajes: 269
Antigüedad: 11 años, 4 meses
Puntos: 22
Respuesta: Update no deseado al Insertar un registro con hibernate

Cita:
Iniciado por Fuzzylog Ver Mensaje
Con esto me intenta hacer un update de A cuando inserto B:

EntityB objB = new EntityB();
List<EntityA] listA = dao.findByName(aName);
if (listA != null && !listA.isEmpty()) {
objB.setObjA(dao.findById(listA.get(0).getId()));
}

Y con esto no:

objB.setObjA(dao.findById(anId));

Lo dicho, no entiendo nada, pero al menos puedo evitar el problema.
Pero si es lo mismo no?