public String update() { System.out.println("Ingreso a actualizar: " + current.getUsuario()); ejbFacade.edit(current); System.out.println("Ya actualicé el paralelo: " + current.getUsuario()); this.endConversation(); return "/users/List"; }
public void setUsersId(Long usersId) { conversation.begin(); if (usersId != null && usersId.longValue() > 0) { // Verifica que el id no sea vacío this.current = ejbFacade.find(usersId); // BUsca un paralelo de acuerdo al ID y lo asigna a current this.usersId = current.getId(); System.out.println("Ingreso a editar users: " + current.getUsuario()); } else { System.out.println("Ingreso a crear un nuevo users"); this.current = new Users(); } }
public Long getUsersId() { if (current != null) { this.usersId = current.getId(); return this.usersId; } return null; }
public String delete() { System.out.println("Ingreso a eliminar el users: " + current.getUsuario()); ejbFacade.remove(current); System.out.println("ya eliminé el users"); this.endConversation(); return "/users/List"; }
// ____________________________MÉTODOS_______________________________ public String persist() { System.out.println("Ingreso a grabar el users: " + current.getUsuario()); ejbFacade.create(current); this.endConversation(); String summary = ResourceBundle.getBundle("/Bundle").getString("CursoCreated"); JsfUtil.addInformacionMessage(summary); FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true); return "/index"; }