April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
JPA – flush
nForca a atualização dos objetos do EM no BD
npublic void flush();
n
nEntityManager em;
n........
npublic Employee raiseEmpSalary(int id, float raise) {
n  Employee e = em.find(Employee.class, id);
n  if( e != null ) {
n    e.setSalary(e.getSalary()+ raise);
n  }
n  em.flush();  // equivale em.getTransaction().commit();
n  return e;
n}