<commit_before>package fr.pizzeria.admin.metier;

import fr.pizzeria.model.Pizza;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
public class PizzaService {

  @PersistenceContext private EntityManager em;


  public List<Pizza> findAll() {
    return em.createQuery("select p from Pizza p", Pizza.class).getResultList();
  }

}
<commit_msg>#4 Crud EJB dans pizzaService<commit_after>package fr.pizzeria.admin.metier;

import fr.pizzeria.model.Pizza;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
public class PizzaService {

	@PersistenceContext
	private EntityManager em;

	public List<Pizza> findAll() {
		return em.createQuery("select p from Pizza p", Pizza.class).getResultList();
	}

	public void update(String code, Pizza pizza) {

		Pizza pizzaMod = em.createQuery("select piz from Pizza piz where piz.code=:codP", Pizza.class)
				.setParameter("codP", code).getSingleResult();
		pizza.setId(pizzaMod.getId());
		em.merge(pizza);

	}

	public void delete(String code) {

		Pizza pizzaDel = em.createQuery("select piz from Pizza piz where piz.code=:codP", Pizza.class)
				.setParameter("codP", code).getSingleResult();

		em.remove(pizzaDel);

	}

	public void save(Pizza pizza) {

		em.persist(pizza);

	}

}

{'fraction_non_alphanumeric': 0.11450381679389313, 'fraction_numerical': 0.0006939625260235947, 'mean_word_length': 4.677165354330708, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4156371', 'n_tokens_mistral': 512, 'n_tokens_neox': 472, 'n_words': 106}