@Override
public void doSave() throws EJbsObject {
logger.debug("Saving data...");
try {
TeamsRemote teams = (TeamsRemote)ClientTools.getRemoteBean(TeamsRemote.class);
super.doSave();
if (this.getDlgState() == DlgState.dsInsert) {
logger.debug("Adding new entity");
teams.createTeam(this.getTeam());
} else if (this.getDlgState() == DlgState.dsEdit) {
logger.debug("Saving existing entity " + this.getTeam().getId() + ".");
teams.updateTeam(this.getTeam());
}
logger.debug("Entity saved.");
} catch (NamingException e) {
logger.error("Error saving team.", e);