public PersonEJB(EntityManager em) {
this.em = em;
}
public Long saveIndividual(Long id, Civilite civ, String nom, String prenom, Date naissance, String email) {
Individual indiv;
if (id == null) {
indiv = new Individual(email, civ, nom, prenom, naissance);
createPerson(indiv);
} else {
indiv = em.find(Individual.class, id);
indiv.setTitre(civ);
indiv.setNom(nom);
indiv.setPrenom(prenom);
indiv.setAnniversaire(naissance);
indiv.setEmail(email);
indiv = em.merge(indiv);
}
return indiv.getId();
}