@Override
public void doSave() throws EJbsObject {
logger.info("Saving data...");
try {
AccountEntriesRemote accountEntries = (AccountEntriesRemote)ClientTools.getRemoteBean(AccountEntriesRemote.class);
super.doSave();
if (this.getDlgState() == DlgState.dsInsert) {
logger.info("Adding new entity");
accountEntries.createDataset(this.getAccountEntry(), ClientGlobals.getUser(), ClientGlobals.getCompany());
} else if (this.getDlgState() == DlgState.dsEdit) {
logger.info("Saving existing entity " + this.getAccountEntry().getId() + ".");
accountEntries.updateDataset(this.getAccountEntry(), ClientGlobals.getUser());
}
System.out.println("Entity saved.");
} catch (NamingException e) {
e.printStackTrace();
}