}
@Override
public void updateConference(Conference c, Integer id) {
Integer conferenceID = null;
Conference newForm = c;
Conference oldForm = null;
//Start by looking at Application Table. Application -> Travel ID -> ID Conference
List<Application> allApp = applicationDA.findAll();
for (Application eachApp : allApp) {
if (eachApp.getAccountIdaccount().getIdaccount().equals(id)) {
conferenceID = eachApp.getTravelIdtravel().getConferenceIdconference().getIdconference();
}
}
//Try and match conferenceID to passed id
List<Conference> allConferences = conferenceDA.findAll();
for (Conference eachConf : allConferences) {
if (eachConf.getIdconference().equals(conferenceID)) {
oldForm = eachConf;
//move conferenceID of old conference entry to new entry.
newForm.setIdconference(oldForm.getIdconference());
conferenceDA.edit(newForm);
}
}
}