@Test
 @Transactional
 public void insertOwner() {
   Collection<Owner> owners = this.clinicService.findOwnerByLastName("Schultz");
   int found = owners.size();
   Owner owner = new Owner();
   owner.setFirstName("Sam");
   owner.setLastName("Schultz");
   owner.setAddress("4, Evans Street");
   owner.setCity("Wollongong");
   owner.setTelephone("4444444444");
   this.clinicService.saveOwner(owner);
   Assert.assertNotEquals("Owner Id should have been generated", owner.getId().longValue(), 0);
   owners = this.clinicService.findOwnerByLastName("Schultz");
   assertEquals("Verifying number of owners after inserting a new one.", found + 1, owners.size());
 }
 public void loadPetsAndVisits(final Owner owner) {
   Map<String, Object> params = new HashMap<String, Object>();
   params.put("id", owner.getId().intValue());
   final List<JdbcPet> pets =
       this.namedParameterJdbcTemplate.query(
           "SELECT id, name, birth_date, type_id, owner_id FROM pets WHERE owner_id=:id",
           params,
           new JdbcPetRowMapper());
   for (JdbcPet pet : pets) {
     owner.addPet(pet);
     pet.setType(EntityUtils.getById(getPetTypes(), PetType.class, pet.getTypeId()));
     //            List<Visit> visits = this.visitRepository.findByPetId(pet.getId());
     //            for (Visit visit : visits) {
     //                pet.addVisit(visit);
     //            }
   }
 }