Object obj;
obj=client.getIdClient()!=null?this.find(Client.class, client.getIdClient(), em):null;
if(obj==null)
persist(client, em);
else {
Client oldclient=(Client) obj;
oldclient.setAdresse(client.getAdresse());
oldclient.setPrenom(client.getPrenom());
oldclient.setNom(client.getNom());
oldclient.setTel1(client.getTel1());
oldclient.setTel2(client.getTel2());
oldclient.setDatNaiss(client.getDatNaiss());
oldclient.setEmail(client.getEmail());
oldclient.setFax(client.getFax());
oldclient.setLieuNaiss(client.getLieuNaiss());
oldclient.setNumPiece(client.getNumPiece());
persist(oldclient, em);
}
tx.commit();
em.close();
return true;