Example usage for org.hibernate Criteria setMaxResults

List of usage examples for org.hibernate Criteria setMaxResults

Introduction

In this page you can find the example usage for org.hibernate Criteria setMaxResults.

Prototype

public Criteria setMaxResults(int maxResults);

Source Link

Document

Set a limit upon the number of objects to be retrieved.

Usage

From source file:com.inkubator.hrm.dao.impl.SchedulerConfigDaoImpl.java

@Override
public List<SchedulerConfig> getByParam(SchedulerConfigSearchParameter searchParameter, int firstResult,
        int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchByParam(searchParameter, criteria);
    criteria.addOrder(order);//from w ww  .j  a  v  a  2 s .  c  o m
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

From source file:com.inkubator.hrm.dao.impl.SchedulerLogDaoImpl.java

@Override
public List<SchedulerLog> getByParam(SchedulerLogSearchParameter searchParameter, int firstResult,
        int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchByParam(searchParameter, criteria);
    criteria.addOrder(order);//from  w  w w.ja v  a2  s.  co  m
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

From source file:com.inkubator.hrm.dao.impl.SystemLetterReferenceDaoImpl.java

@Override
public List<SystemLetterReference> getByParam(SystemLetterReferenceSearchParameter parameter, int firstResult,
        int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchSystemLetterReferenceByParam(parameter, criteria);
    criteria.addOrder(order);/*from w w w  . ja  v  a 2  s  .  com*/
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

From source file:com.inkubator.hrm.dao.impl.SystemScoringDaoImpl.java

@Override
public List<SystemScoring> getByParam(SystemScoringSearchParameter searchParameter, int firstResult,
        int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchByParam(searchParameter, criteria);
    criteria.addOrder(order);//from  w ww  .j a  v  a 2  s  .c o  m
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

From source file:com.inkubator.hrm.dao.impl.SystemScoringIndexDaoImpl.java

@Override
public List<SystemScoringIndex> getAllByParam(Long systemScoringId, int firstResult, int maxResults,
        Order order) {/*from  w w  w.  j a v a 2  s  .  co m*/
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("systemScoring.id", systemScoringId));
    criteria.addOrder(order);
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

From source file:com.inkubator.hrm.dao.impl.TempAttendanceRealizationDaoImpl.java

@Override
public List<TempAttendanceRealization> getByParam(TempAttendanceRealizationSearchParameter parameter,
        int firstResult, int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchTempAttendanceRealizationByParam(parameter, criteria);
    criteria.addOrder(order);//w w  w.  ja va  2 s. co  m
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    criteria.setFetchMode("empData", FetchMode.JOIN);
    criteria.setFetchMode("empData.jabatanByJabatanId", FetchMode.JOIN);
    criteria.setFetchMode("empData.bioData", FetchMode.JOIN);
    return criteria.list();
}

From source file:com.inkubator.hrm.dao.impl.TempAttendanceRealizationDaoImpl.java

@Override
public List<TempAttendanceRealization> getPaidOvertimeByParam(PaidOvertimeSearchParameter searchParameter,
        int firstResult, int maxResults, Order orderable) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchPaidOvertimeByParam(searchParameter, criteria);
    criteria.addOrder(orderable);// w w w  .java 2  s. c o m
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

From source file:com.inkubator.hrm.dao.impl.UnregSalaryDaoImpl.java

@Override
public List<UnregSalary> getByParam(UnregSalarySearchParameter searchParameter, int firstResult, int maxResults,
        Order order) {//from   w w  w  .  j a va2 s  .  c  o m
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.setFetchMode("wtPeriode", FetchMode.JOIN);
    doSearchByParam(searchParameter, criteria);
    criteria.addOrder(order);
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

From source file:com.inkubator.hrm.dao.impl.UnregSalaryDaoImpl.java

@Override
public List<UnregSalary> getByParamBySalaryCalculation(UnregSalarySearchParameter searchParameter,
        Date fromPeriodPayrollType, int firstResult, int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("wtPeriode", "wtPeriode", JoinType.INNER_JOIN);
    criteria.add(Restrictions.eq("isAlreadyPaid", false));
    criteria.add(Restrictions.lt("wtPeriode.fromPeriode", fromPeriodPayrollType));
    doSearchByParam(searchParameter, criteria);
    criteria.addOrder(order);//w  w  w  . j  a v  a 2 s. com
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();

}

From source file:com.inkubator.hrm.dao.impl.UnregSalaryDaoImpl.java

@Override
public List<UnregSalary> getByParamBySalaryPayroll(UnregSalarySearchParameter searchParameter,
        Date fromPeriodPayrollType, int firstResult, int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("wtPeriode", "wtPeriode", JoinType.INNER_JOIN);
    criteria.add(Restrictions.lt("wtPeriode.fromPeriode", fromPeriodPayrollType));
    doSearchByParam(searchParameter, criteria);
    criteria.addOrder(order);/*from  ww w  . j  a  v  a 2s  . co  m*/
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();

}