这是我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);}