I have following class:
public class Person {
private String firstName;
private String lastName;
private List<String> habits;
}
I have Postgres query which returns me following result using inner join from 2 tables
name | lastname| habits
--------------------------------------
John | Smith | ["walking", "eating"]
I am trying to write RowMapper as following:
private final RowMapper<Person> rowMapper = (rs, rowNum) -> {
String firstName = rs.getString("name");
String lastName = rs.getString("lastName");
}
I am not sure how to create List habits from "habits column in my result table"
Please advise
Thanks