@Override
public void doSave() throws EJbsObject {
System.out.println("Saving data...");
try {
JbsCompaniesRemote companies = (JbsCompaniesRemote) ClientTools.getRemoteBean(JbsCompaniesRemote.class);
super.doSave();
if (this.getDlgState() == DlgState.dsInsert) {
System.out.println("Adding new entity " + this.getCompany().getId() + ".");
companies.createCompany(this.getCompany());
} else if (this.getDlgState() == DlgState.dsEdit) {
System.out.println("Saving existing entity " + this.getCompany().getId() + ".");
companies.updateCompany(this.getCompany());
}
System.out.println("Entity saved.");
} catch (NamingException e) {
e.printStackTrace();