public String search() {
   if (searchterm == null || searchterm.isEmpty()) {
     this.ownerList = ownerDao.getAll();
   } else {
     try {
       this.ownerList = ownerDao.search(searchterm);
     } catch (Exception e) {
       this.ownerList = ownerDao.getAll();
     }
   }
   return "owners.jsf";
 }
 public String addNewPet() {
   PetType petType = petTypeDao.findById(this.petTypeId);
   this.pet.setType(petType);
   this.owner.addPet(this.pet);
   petDao.addNew(this.pet);
   ownerDao.update(this.owner);
   return "showOwner.jsf";
 }
 public String delete(long id) {
   ownerDao.delete(id);
   this.ownerList = ownerDao.getAll();
   return "owners.jsf";
 }
 public String saveEditedOwner() {
   ownerDao.update(this.owner);
   this.ownerList = ownerDao.getAll();
   return "showOwner.jsf";
 }
 public String showOwner(long id) {
   this.owner = ownerDao.findById(id);
   return "showOwner.jsf";
 }
 public String saveNewOwner() {
   ownerDao.addNew(this.owner);
   this.ownerList = ownerDao.getAll();
   return "owners.jsf";
 }