@Override public String getAsString(FacesContext facesContext, UIComponent component, Object object) { if (object == null) { return null; } if (object instanceof Professeur) { Professeur o = (Professeur) object; return getStringKey(o.getIdProfesseur()); } else { throw new IllegalArgumentException( "object " + object + " is of type " + object.getClass().getName() + "; expected type: " + Professeur.class.getName()); } }
private void performDestroy() { try { getFacade().remove(current); JsfUtil.addSuccessMessage( ResourceBundle.getBundle("/Bundle").getString("ProfesseurDeleted"), current.getNom()); } catch (Exception e) { JsfUtil.addErrorMessage( e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); } }
public String create() { try { getFacade().create(current); JsfUtil.addSuccessMessage("Le professeur : " + current.getNom(), "a été bien crée"); return prepareCreate(); } catch (Exception e) { JsfUtil.addErrorMessage( e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); return null; } }
public String update() { try { getFacade().edit(current); JsfUtil.addSuccessMessage( "Les informations du professeur : " + current.getNom(), "ont été bien modifié"); return "List"; } catch (Exception e) { JsfUtil.addErrorMessage( e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); return null; } }