Exemple #1
0
 @Override
 public void update(Article article) {
   Article a1 = em.find(Article.class, article.getReference());
   a1.setPrix(article.getPrix());
   a1.setQuantite(article.getQuantite());
   a1.setTva(article.getTva());
   a1.setLibelle(article.getLibelle());
   em.persist(a1);
 }
Exemple #2
0
  @Override
  public void delete(Article article) {

    if (em.find(Article.class, article.getReference()) != null)
      em.remove(em.find(Article.class, article.getReference()));
  }