Package org.hibernate

Examples of org.hibernate.Criteria.list()


        .add(Restrictions.eq("prompt", mPrompt.getObject()))
        .add(Restrictions.eq("user", mUser.getObject()))
        .add(Restrictions.eq("valid", true))
        .setCacheable(true)
        .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
    return criteria.list();
  }

  /* (non-Javadoc)
   * @see org.cast.isi.service.IISIResponseService#getAllResponsesForCollectionByStudent(String, org.apache.wicket.model.IModel<org.cast.cwm.data.User>)
   */
 
View Full Code Here


        .add(Restrictions.eq("p.collectionName", collectionName))
        .add(Restrictions.eq("user", mUser.getObject()))
        .add(Restrictions.eq("valid", true))
        .setCacheable(true)
        .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
    return new ListModel<ISIResponse>(criteria.list());
  }

  /* (non-Javadoc)
   * @see org.cast.isi.service.IISIResponseService#gePeriodResponsesForPrompt(org.apache.wicket.model.IModel<org.cast.isi.data.ISIPrompt>,org.apache.wicket.model.IModel<org.cast.cwm.data.Period>)
   */
 
View Full Code Here

        .add(Restrictions.eq("p.id", mPeriod.getObject().getId()))
        .add(Restrictions.eq("prompt", mPrompt.getObject()))
        .add(Restrictions.eq("valid", true))
        .setCacheable(true)
        .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
    return new ListModel<ISIResponse>(criteria.list());
  }

}
View Full Code Here

    return (HibernateDaoImpl) ctx.getBean("HibernateDaoImpl");
  }
 
  public List loadAll(final Class entityClass) throws DataAccessException {
    Criteria criteria = this.getSession().createCriteria(entityClass);
    return criteria.list();
  }

  public List loadAll(final Class entityClass, final int firstResult, final int maxResult) throws DataAccessException {
    Criteria criteria = getSession().createCriteria(entityClass).setFirstResult(firstResult).setMaxResults(maxResult);
    return criteria.list();
View Full Code Here

    return criteria.list();
  }

  public List loadAll(final Class entityClass, final int firstResult, final int maxResult) throws DataAccessException {
    Criteria criteria = getSession().createCriteria(entityClass).setFirstResult(firstResult).setMaxResults(maxResult);
    return criteria.list();
  }
 
  public List findByCriterions(Class clazz, List restrictions) throws DataAccessException {
    List objs = new ArrayList();
    Criteria criteria = getSession().createCriteria(clazz);
View Full Code Here

    List objs = new ArrayList();
    Criteria criteria = getSession().createCriteria(clazz);
    Iterator it = restrictions.iterator();
    while (it.hasNext())
      criteria.add((Criterion) it.next());
    objs = criteria.list();
    return objs;
  }

  public List findByCriterions(Class clazz, List restrictions, int firstResult, int maxResult) throws DataAccessException {
    List objs = new ArrayList();
View Full Code Here

    List objs = new ArrayList();
    Criteria criteria = getSession().createCriteria(clazz).setFirstResult(firstResult).setMaxResults(maxResult);
    Iterator it = restrictions.iterator();
    while (it.hasNext())
      criteria.add((Criterion) it.next());
    objs = criteria.list();
    return objs;
  }
}
View Full Code Here

      HibernateUtil.orderSupport(criteria, orders);
      for (Order order : orders) {
        criteria.addOrder(order);
      }
      result.addAll((List<Object[]>) criteria.list());
    } catch (HibernateException e) {
      handleException(e);
    }

    return result;
View Full Code Here

      }

      criteria.setFirstResult(startIndex);
      criteria.setMaxResults(rowAmount);

      result.addAll((List<Object[]>) criteria.list());
    } catch (HibernateException e) {
      handleException(e);
    }

    return new DataResult(result, rowCount, rowAmount);
View Full Code Here

      HibernateUtil.criterionSupport(criteria, criterions);
      for (Criterion criterion : criterions) {
        criteria.add(criterion);
      }
      result.addAll((List<Object[]>) criteria.list());
    } catch (HibernateException e) {
      handleException(e);
    }
    return result;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.