Skip to content
Snippets Groups Projects
Commit 91d19d17 authored by Antoine Rey's avatar Antoine Rey
Browse files

#92 Fix column 'visits.id' not found on MySql

parent 39ab8361
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,7 @@ public class JdbcVisitRepositoryImpl implements VisitRepository {
@Override
public List<Visit> findByPetId(Integer petId) {
return this.jdbcTemplate.query(
"SELECT id as visit_id, visit_date, description FROM visits WHERE pet_id=?",
"SELECT id, visit_date, description FROM visits WHERE pet_id=?",
new JdbcVisitRowMapper(), petId);
}
......
......@@ -33,7 +33,7 @@ class JdbcVisitRowMapper implements RowMapper<Visit> {
@Override
public Visit mapRow(ResultSet rs, int row) throws SQLException {
Visit visit = new Visit();
visit.setId(rs.getInt("visits.id"));
visit.setId(rs.getInt("id"));
Date visitDate = rs.getDate("visit_date");
visit.setDate(new DateTime(visitDate));
visit.setDescription(rs.getString("description"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment