Skip to content

Commit

Permalink
Fix JDBC’s loadPetsAndVisits: OneToManyResultSetExtractor requires li…
Browse files Browse the repository at this point in the history
…nes order by primary key
  • Loading branch information
arey committed Jun 27, 2018
1 parent 03a1724 commit dea6801
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -112,7 +112,7 @@ public void loadPetsAndVisits(final Owner owner) {
Map<String, Object> params = new HashMap<>();
params.put("id", owner.getId());
final List<JdbcPet> pets = this.namedParameterJdbcTemplate.query(
"SELECT pets.id, name, birth_date, type_id, owner_id, visits.id as visit_id, visit_date, description, pet_id FROM pets LEFT OUTER JOIN visits ON pets.id = pet_id WHERE owner_id=:id",
"SELECT pets.id, name, birth_date, type_id, owner_id, visits.id as visit_id, visit_date, description, pet_id FROM pets LEFT OUTER JOIN visits ON pets.id = pet_id WHERE owner_id=:id ORDER BY pet_id",
params,
new JdbcPetVisitExtractor()
);
Expand Down

0 comments on commit dea6801

Please sign in to comment.