How can I map a resultset from a few tables into a complex object? let me elaborate:
Lets say I have these 2 classes:
public class User {
private int
Create a HashMap of where user id is the key, and user is the value. Then when you process the result set, do map.get(resultset.get(userid)), if it's null, create a new user, but if it isn't then do the logic to append a user to the country.
HashMap users;
HashMap countries;
//inside the result set processing
User u = users.get(resultSet.get("id"));
if(null != u) {
//populate user here
} else {
Country c = countries.get(resultSet.get(country);
c.users.add(u);
}