Example usage for org.hibernate Criteria setFirstResult

List of usage examples for org.hibernate Criteria setFirstResult

Introduction

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

Prototype

public Criteria setFirstResult(int firstResult);

Source Link

Document

Set the first result to be retrieved.

Usage

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

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

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

@Override
public List<RecruitLetters> getByParam(RecrutimentLetterSearchParameter parameter, int firstResult,
        int maxResults, Order orderable) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchRecruitLettersByParam(parameter, criteria);
    criteria.setFetchMode("empData", FetchMode.JOIN);
    criteria.setFetchMode("empData.bioData", FetchMode.JOIN);
    criteria.addOrder(orderable);//from   w w w.java2s.  c om
    criteria.addOrder(orderable);
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

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

@Override
public List<RecruitmenSelectionSeries> getByParam(RecruitmenSelectionSeriesSearchParameter searchParameter,
        int firstResult, int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchByParam(searchParameter, criteria);
    criteria.addOrder(order);// w w w.j  a  va  2s. com
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

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

@Override
public List<RecruitmenSelectionSeriesDetail> getByParam(int firstResult, int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.addOrder(order);/*  ww w.jav  a 2  s  .  c om*/
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

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

@Override
public List<RecruitmenSelectionSeriesDetail> getAllDataBySelectionSeriesId(Long id, int firstResult,
        int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("recruitmenSelectionSeries.id", id));
    criteria.setFetchMode("recruitmenSelectionSeries", FetchMode.JOIN);
    criteria.setFetchMode("recruitSelectionType", FetchMode.JOIN);
    criteria.setFetchMode("recruitLettersByAcceptLetterId", FetchMode.JOIN);
    criteria.setFetchMode("recruitLettersByRejectLetterId", FetchMode.JOIN);
    criteria.addOrder(order);/*from ww w  .j  ava  2  s  .c  om*/
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

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

@Override
public List<RecruitSelectionType> getByParam(RecruitSelectionTypeSearchParameter searchParameter,
        int firstResult, int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchByParam(searchParameter, criteria);
    criteria.addOrder(order);// w  ww  .  ja  v a  2  s .  com
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

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

@Override
public List<RecruitVacancySelection> getByParam(RecruitVacancySelectionSearchParameter searchParameter,
        int firstResult, int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchByParam(searchParameter, criteria);
    criteria.setFetchMode("recruitHireApply", FetchMode.JOIN);
    criteria.setFetchMode("recruitHireApply.jabatan", FetchMode.JOIN);
    criteria.setFetchMode("recruitHireApply.employeeType", FetchMode.JOIN);
    criteria.setFetchMode("recruitHireApply.recruitMppPeriod", FetchMode.JOIN);
    criteria.setFetchMode("recruitmenSelectionSeries", FetchMode.JOIN);
    criteria.addOrder(order);/*from w  ww  .j av  a 2s . c  om*/
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

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

@Override
public List<RiwayatAkses> getDataByUserId(String userID, int firstResult, int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("userId", userID));
    criteria.addOrder(order);//from  w  w  w  . j  a v  a 2  s. co  m
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

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

@Override
public List<RiwayatAkses> getRiwayatAksesByUserIdWithModel(String userID, int firstResult, int maxResults,
        Order order) {/*from   w  ww .  j a  va  2s .  c o  m*/
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("userId", userID));
    criteria.addOrder(order);
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    criteria.setFetchMode("hrmMenu", FetchMode.JOIN);
    return criteria.list();
}

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);//  w ww. j  a va2 s.  co  m
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}