Example #1
0
 public void delete() {
   Job deletedJob = jobRepo.deleteById(job.getId());
   if (deletedJob == null) {
     FacesContext.getCurrentInstance().addMessage("growl", new FacesMessage("Job not deleted"));
   } else {
     FacesContext.getCurrentInstance()
         .addMessage("growl", new FacesMessage("Job successfully deleted"));
   }
   job = new Job();
   jobs = jobRepo.listAll();
 }
Example #2
0
 public void save() {
   Job saveJob = jobRepo.saveJob(job);
   if (saveJob.getId().equals(job.getId())) {
     FacesContext.getCurrentInstance()
         .addMessage("growl", new FacesMessage("Job successfully updated"));
   } else {
     FacesContext.getCurrentInstance()
         .addMessage("growl", new FacesMessage("Job successfully added"));
   }
   job = new Job();
   jobs = jobRepo.listAll();
 }
Example #3
0
 @PostConstruct
 private void init() {
   jobs = jobRepo.listAll();
   System.out.println(this);
 }