Exemplo n.º 1
0
  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;
  }
Exemplo n.º 2
0
 public long count(String search) {
   TypedQuery<Long> q =
       em.createQuery(
           DaoHelper.getSearchQuery("Configuration", "c", search, true, true, null, searchFields),
           Long.class);
   return q.getSingleResult();
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
 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();
 }