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; }
public long count(String search) { TypedQuery<Long> q = em.createQuery( DaoHelper.getSearchQuery("Configuration", "c", search, true, true, null, searchFields), Long.class); return q.getSingleResult(); }
public List<Configuration> get(String search, int start, int count, String sort) { TypedQuery<Configuration> q = em.createQuery( DaoHelper.getSearchQuery("Configuration", "c", search, true, false, sort, searchFields), Configuration.class); q.setFirstResult(start); q.setMaxResults(count); return q.getResultList(); }
public long count(Long language_id, String search) { String sql = DaoHelper.getSearchQuery( "Fieldlanguagesvalues", "flv", search, true, true, "flv.fieldvalues.deleted = false AND flv.language_id = :lang", null, searchFields); TypedQuery<Long> q = em.createQuery(sql, Long.class); q.setParameter("lang", language_id); return q.getSingleResult(); }