@Override
    public Collection<Vet> findAll() {
        // Retrieve the list of all vets.
        List<Vet> vets = new ArrayList<>(this.jdbcClient.sql(
                "SELECT id, first_name, last_name FROM vets ORDER BY last_name,first_name")
            .query(BeanPropertyRowMapper.newInstance(Vet.class))
            .list());

        // Retrieve the list of all possible specialties.
        final List<Specialty> specialties = this.jdbcClient.sql("SELECT id, name FROM specialties")
            .query(BeanPropertyRowMapper.newInstance(Specialty.class))
            .list();

        // Build each vet's list of specialties.
        for (Vet vet : vets) {
            final List<Integer> vetSpecialtiesIds = this.jdbcClient.sql(
                    "SELECT specialty_id FROM vet_specialties WHERE vet_id=?")
                .param(vet.getId())
                .query(
                    new BeanPropertyRowMapper<Integer>() {
                        @Override
                        public Integer mapRow(ResultSet rs, int row) throws SQLException {
                            return rs.getInt(1);
                        }
                    }
                ).list();
            for (int specialtyId : vetSpecialtiesIds) {
                Specialty specialty = EntityUtils.getById(specialties, Specialty.class, specialtyId);
                vet.addSpecialty(specialty);
            }
        }
        return vets;
    }
Refresh the cache of Vets that the ClinicService is holding.
src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcVetRepositoryImpl.java