public Resolution saveChanges() {
PersonManager pm = new PersonManager();
// Apply any changes to existing people (and create new ones)
for (Person person : people) {
Person realPerson;
if (person.getId() == null) {
realPerson = new Person();
}
else {
realPerson = pm.getPerson(person.getId());
}
realPerson.setEmail(person.getEmail());
realPerson.setFirstName(person.getFirstName());
realPerson.setLastName(person.getLastName());
realPerson.setUsername(person.getUsername());
if (person.getPassword() != null) {
realPerson.setPassword(person.getPassword());
}
pm.saveOrUpdate(realPerson);
}