2627282930313233343536
public Object getAsObject(FacesContext context, UIComponent component, String value) { if (value == null || value.length() == 0){ return null; } UserHD sotrudnik = userHDService.find(Long.valueOf(value)); if (sotrudnik == null) { throw new ConverterException(new FacesMessage("Unknown UserHD ID: " + value)); }
3334353637383940414243
super(UserHD.class); } public UserHD findByLogin(String name) { UserHD s = null; CriteriaBuilder cb = getEntityManager().getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(); Root<UserHD> z = cq.from(UserHD.class); cq.where(cb.equal(z.get(UserHD_.login), name)); cq.select(z);
798081828384858687
public void deleteUser() { getUserHDService().remove(currentUser); } public void addNewUser() { currentUser = new UserHD(); currentUser.setRole(new Role()); listAllUsers.add(0, currentUser); }