コード例 #1
0
 public String saveEditedPet() {
   PetType petType = petTypeDao.findById(this.petTypeId);
   this.pet.setType(petType);
   petDao.update(this.pet);
   long ownerId = this.owner.getId();
   this.owner = this.ownerDao.findById(ownerId);
   return "showOwner.jsf";
 }
コード例 #2
0
 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";
 }
コード例 #3
0
 public String saveVisit() {
   visitDao.addNew(this.visit);
   this.visit.setPet(this.pet);
   this.pet.addVisit(this.visit);
   petDao.update(this.pet);
   long ownerId = this.owner.getId();
   this.owner = this.ownerDao.findById(ownerId);
   return "showOwner.jsf";
 }
コード例 #4
0
 public String addVisitToPetForm(long petId) {
   this.pet = petDao.findById(petId);
   this.petTypeId = this.pet.getType().getId();
   this.visit = new Visit();
   return "addVisitToPet.jsf";
 }
コード例 #5
0
 public String editPetForm(long petId) {
   this.pet = petDao.findById(petId);
   this.petTypeId = this.pet.getType().getId();
   return "editPet.jsf";
 }