public List<Fieldvalues> get(Long language_id, String search, int start, int count, String sort) { String sql = DaoHelper.getSearchQuery( "Fieldlanguagesvalues", "flv", search, true, false, "flv.fieldvalues.deleted = false AND flv.language_id = :lang", sort, searchFields); TypedQuery<Fieldlanguagesvalues> q = em.createQuery(sql, Fieldlanguagesvalues.class); q.setParameter("lang", language_id); q.setFirstResult(start); q.setMaxResults(count); // now lets create the list of Fieldvalues List<Fieldlanguagesvalues> flvList = q.getResultList(); List<Fieldvalues> r = new ArrayList<Fieldvalues>(flvList.size()); for (Fieldlanguagesvalues flv : flvList) { Fieldvalues fv = flv.getFieldvalues(); fv.setFieldlanguagesvalue(flv); r.add(fv); } return r; }
@Override protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) { Fieldlanguagesvalues flv = getModelObject(); Fieldvalues fv = flv.getFieldvalues(); Application.getBean(FieldValueDao.class).update(fv, WebSession.getUserId()); flv.setFieldvalues(fv); Application.getBean(FieldLanguagesValuesDao.class).update(flv, WebSession.getUserId()); hideNewRecord(); target.add(panel.listContainer); target.appendJavaScript("labelsInit();"); }