これは、SaveClient()
すべてのフィールドが空の場合でも新しいクライアントを作成する私の方法です!
public void SaveClient() {
client = new Client();
client.setNom(nom);
client.setPrenom(prenom);
client.setAdresse(adresse);
client.setDomaine(domaine);
client.setRaisonSociale(raisonSociale);
client.setDateDAbonnement(dateDAbonnement);
client.setDateFAbonnement(dateFAbonnement);
client.setType(type);
client.setEmail(email);
client.setnFixe(nFixe);
client.setnGsm(nGsm);
client.setnFixe2(nFixe2);
client.setnGsm2(nGsm2);
client.setVille(ville);
client.setPays(pays);
Set<ConstraintViolation<Client>> violations = validator
.validate(client);
basicController.<Client> processValidation(violations);
if (violations.size() == 0) {
clientBean.creerClient(client);
basicController.addMessage(" Client has been created successfully",
FacesMessage.SEVERITY_INFO, null);}