public String create() { try { current .getProjectPK() .setClientDepartmentNumber(current.getClient().getClientPK().getClientDepartmentNumber()); current.getProjectPK().setClientName(current.getClient().getClientPK().getClientName()); getFacade().create(current); JsfUtil.addSuccessMessage( ResourceBundle.getBundle("/resources/Bundle").getString("ProjectCreated")); return prepareCreate(); } catch (Exception e) { JsfUtil.addErrorMessage( e, ResourceBundle.getBundle("/resources/Bundle").getString("PersistenceErrorOccured")); return null; } }
public Project getSelected() { if (current == null) { current = new Project(); current.setProjectPK(new jpa.entities.ProjectPK()); selectedItemIndex = -1; } return current; }
@Override public String getAsString(FacesContext facesContext, UIComponent component, Object object) { if (object == null) { return null; } if (object instanceof Project) { Project o = (Project) object; return getStringKey(o.getProjectPK()); } else { throw new IllegalArgumentException( "object " + object + " is of type " + object.getClass().getName() + "; expected type: " + Project.class.getName()); } }
public String prepareCreate() { current = new Project(); current.setProjectPK(new jpa.entities.ProjectPK()); selectedItemIndex = -1; return "Create"; }