¿Qué está pasando aquí?La entidad se debe administrar para llamar a eliminar
@Stateless
@LocalBean
public class AppointmentCommentDao {
public void delete(long appointmentCommentId) {
AppointmentComment ac = em.find(AppointmentComment.class, appointmentCommentId);
if (ac != null)
{
em.merge(ac);
em.remove(ac);
}
}
@PersistenceContext
private EntityManager em;
}
En la llamada a remove
me sale un IllegalArgumentException
con ser el mensaje Entity must be managed to call remove: ...., try merging the detached and try the remove again.
lo resolvió con el método em.find (...). –