|
|
@@ -54,8 +54,8 @@ public class PersonService {
|
|
54
|
54
|
e.getFirstName() + "', LAST_NAME = '" +
|
|
55
|
55
|
e.getLastName() + "', MOBILE = '" +
|
|
56
|
56
|
e.getMobile() + "', BIRTHDAY = '" +
|
|
57
|
|
- e.getBirthday() + "', HOME_ID = '" +
|
|
58
|
|
- e.getHomeId() + "' where id = '" + e.getId() + "');");
|
|
|
57
|
+ e.getBirthday() + "', HOME_ID = " +
|
|
|
58
|
+ e.getHomeId() + " where id = " + e.getId() + ";");
|
|
59
|
59
|
}
|
|
60
|
60
|
|
|
61
|
61
|
public int deletePerson(Person e){
|
|
|
@@ -73,7 +73,13 @@ public class PersonService {
|
|
73
|
73
|
}
|
|
74
|
74
|
|
|
75
|
75
|
public Person findById(int ID){
|
|
76
|
|
- return jdbcTemplate.queryForObject("SELECT * FROM PERSON WHERE ID = " + ID + ";", Person.class);
|
|
|
76
|
+ List<Person> people = getAllPeople();
|
|
|
77
|
+ for(Person person : people){
|
|
|
78
|
+ if(person.getId() == ID){
|
|
|
79
|
+ return person;
|
|
|
80
|
+ }
|
|
|
81
|
+ }
|
|
|
82
|
+ return null;
|
|
77
|
83
|
}
|
|
78
|
84
|
|
|
79
|
85
|
public Map<String, List<Person>> surnameQuery(){
|