if (this.getDlgState() == DlgState.dsInsert) {
System.out.println("Adding new entity " + this.getUser().getId() + ".");
jbsUsers.createUser(this.getUser());
} else if (this.getDlgState() == DlgState.dsEdit) {
System.out.println("Saving existing entity " + this.getUser().getId() + ".");
jbsUsers.updateUser(this.getUser());
}
System.out.println("Entity saved.");
} catch (NamingException e) {
e.printStackTrace();