Example usage for org.hibernate FetchMode JOIN

List of usage examples for org.hibernate FetchMode JOIN

Introduction

In this page you can find the example usage for org.hibernate FetchMode JOIN.

Prototype

FetchMode JOIN

To view the source code for org.hibernate FetchMode JOIN.

Click Source Link

Document

Fetch using an outer join.

Usage

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

@Override
public PayTempKalkulasi getEntityByPkWithDetail(Long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("id", id));
    criteria.setFetchMode("paySalaryComponent", FetchMode.JOIN);
    criteria.setFetchMode("empData", FetchMode.JOIN);
    criteria.setFetchMode("empData.bioData", FetchMode.JOIN);
    return (PayTempKalkulasi) criteria.uniqueResult();
}

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

@Override
public PayTempKalkulasi getEntityByEmpIdAndModelTakeHomePayId(Long empId) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("empData", "empData", JoinType.INNER_JOIN);
    criteria.createAlias("paySalaryComponent", "paySalaryComponent", JoinType.INNER_JOIN);
    criteria.createAlias("paySalaryComponent.modelComponent", "modelComponent", JoinType.INNER_JOIN);
    criteria.setFetchMode("empData", FetchMode.JOIN);
    criteria.setFetchMode("empData.bioData", FetchMode.JOIN);
    criteria.setFetchMode("empData.golonganJabatan", FetchMode.JOIN);
    criteria.add(Restrictions.eq("empData.id", empId));
    criteria.add(Restrictions.eq("modelComponent.spesific", HRMConstant.MODEL_COMP_TAKE_HOME_PAY));
    return (PayTempKalkulasi) criteria.uniqueResult();
}

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

@Override
public List<PayTempKalkulasi> getAllDataByTotalIncomeBelow(BigDecimal nominal) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("paySalaryComponent", "paySalaryComponent", JoinType.INNER_JOIN);
    criteria.createAlias("paySalaryComponent.modelComponent", "modelComponent", JoinType.INNER_JOIN);
    criteria.setFetchMode("empData", FetchMode.JOIN);
    criteria.add(Restrictions.eq("modelComponent.spesific", HRMConstant.MODEL_COMP_TAKE_HOME_PAY));
    criteria.add(Restrictions.lt("nominal", nominal));
    return criteria.list();
}

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

@Override
public PayTempOvertime getEntityByPkWithDetail(Long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.setFetchMode("empData", FetchMode.JOIN);
    criteria.setFetchMode("empData.bioData", FetchMode.JOIN);
    criteria.add(Restrictions.eq("id", id));
    return (PayTempOvertime) criteria.uniqueResult();
}

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

@Override
public List<Position> getByParam(PositionSearchParameter searchParameter, int firstResult, int maxResults,
        Order order) {//from w ww .  j av  a2  s. c  om
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchPositiontByParam(searchParameter, criteria);
    criteria.setFetchMode("posBiaya", FetchMode.JOIN);
    criteria.setFetchMode("department", FetchMode.JOIN);
    criteria.setFetchMode("golonganJabatan", FetchMode.JOIN);
    criteria.setFetchMode("educationLevel", FetchMode.JOIN);
    criteria.setFetchMode("skJabatan", FetchMode.JOIN);
    criteria.setFetchMode("grade", FetchMode.JOIN);
    criteria.addOrder(order);
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

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

@Override
public RecruitAdvertisementMedia getEntityByPkWithDetail(Long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("id", id));
    criteria.setFetchMode("recruitAdvertisementCategory", FetchMode.JOIN);
    return (RecruitAdvertisementMedia) criteria.uniqueResult();
}

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

@Override
public RecruitAgreementNotice getEntityByBioDataId(Long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("bioData.id", id));
    criteria.setFetchMode("bioData", FetchMode.JOIN);
    return (RecruitAgreementNotice) criteria.uniqueResult();
}

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

@Override
public List<RecruitHireApplyDetail> getListWithDetailByRecruitHireApplyId(Long recruitHireApplyId) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.setFetchMode("orgTypeOfSpecList", FetchMode.JOIN);
    criteria.setFetchMode("recruitHireApply", FetchMode.JOIN);
    criteria.add(Restrictions.eq("recruitHireApply.id", recruitHireApplyId));
    return criteria.list();
}

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

@Override
public RecruitLetters getByPkWithDetail(long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("id", id));
    criteria.setFetchMode("empData", FetchMode.JOIN);
    criteria.setFetchMode("empData.bioData", FetchMode.JOIN);
    criteria.setFetchMode("recruitLetterSelections", FetchMode.JOIN);
    criteria.setFetchMode("recruitLetterSelections.recruitSelectionType", FetchMode.JOIN);
    criteria.setFetchMode("recruitLetterComChannels", FetchMode.JOIN);
    criteria.setFetchMode("recruitLetterComChannels.recruitCommChannels", FetchMode.JOIN);
    return (RecruitLetters) criteria.uniqueResult();
}

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  ww  w  . ja v a 2s.  com*/
    criteria.addOrder(orderable);
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}