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.RecruitVacancySelectionDetailDaoImpl.java

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

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

@Override
public List<RecruitVacancySelectionDetailPic> getAllDataByRecruitVacancySelectionDetailId(Long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());

    criteria.createAlias("recruitVacancySelectionDetail", "recruitVacancySelectionDetail", JoinType.INNER_JOIN);
    criteria.createAlias("recruitVacancySelectionDetail.recruitVacancySelection", "recruitVacancySelection",
            JoinType.INNER_JOIN);/*from  w  w  w . j  ava 2  s .  c  om*/
    criteria.add(Restrictions.eq("recruitVacancySelectionDetail.id", id));
    criteria.setFetchMode("empData", FetchMode.JOIN);
    criteria.setFetchMode("empData.bioData", FetchMode.JOIN);
    criteria.setFetchMode("empData.jabatanByJabatanId", FetchMode.JOIN);
    criteria.setFetchMode("empData.jabatanByJabatanId.department", FetchMode.JOIN);
    criteria.setFetchMode("empData.employeeType", FetchMode.JOIN);
    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) {// w w w  . j  a  v a 2s  . c om
    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.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);/*from ww  w .  ja  v  a  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.TempJadwalKaryawanDaoImpl.java

@Override
public List<TempJadwalKaryawan> getAllByEmpIdWithDetail(long empId) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("empData", "e", JoinType.INNER_JOIN);
    criteria.add(Restrictions.eq("e.id", empId));
    criteria.setFetchMode("wtWorkingHour.attendanceStatus", FetchMode.JOIN);
    criteria.setFetchMode("wtWorkingHour", FetchMode.JOIN);
    criteria.addOrder(Order.asc("tanggalWaktuKerja"));
    return criteria.list();
}

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

@Override
public TempJadwalKaryawan getEntityByEmpDataIdAndTanggalWaktuKerja(Long id, Date implementationDate) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("empData", "empData", JoinType.INNER_JOIN);
    criteria.add(Restrictions.eq("empData.id", id));
    criteria.add(Restrictions.eq("tanggalWaktuKerja", implementationDate));
    criteria.setFetchMode("wtWorkingHour", FetchMode.JOIN);
    return (TempJadwalKaryawan) criteria.uniqueResult();
}

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

@Override
public TempJadwalKaryawan getByEmpId(Long id, Date implementationDate) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("empData", "empData", JoinType.INNER_JOIN);
    criteria.add(Restrictions.eq("empData.id", id));
    criteria.add(Restrictions.eq("tanggalWaktuKerja", implementationDate));
    criteria.setFetchMode("wtWorkingHour", FetchMode.JOIN);
    return (TempJadwalKaryawan) criteria.uniqueResult();
}

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

@Override
public List<TempJadwalKaryawan> getAllByEmpIdWithDetailWithFromAndUntilPeriod(long empId, Date from,
        Date until) {// w w  w.j  ava 2 s  .com
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("empData", "e", JoinType.INNER_JOIN);
    criteria.add(Restrictions.eq("e.id", empId));
    criteria.add(Restrictions.ge("tanggalWaktuKerja", from));
    criteria.add(Restrictions.le("tanggalWaktuKerja", until));
    criteria.setFetchMode("wtWorkingHour.attendanceStatus", FetchMode.JOIN);
    criteria.setFetchMode("wtWorkingHour", FetchMode.JOIN);
    criteria.addOrder(Order.asc("tanggalWaktuKerja"));
    return criteria.list();
}

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

@Override
public List<UnregDepartement> getAllDataByUnregSalaryId(Long unregSalaryId) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("unregSalary", "us");
    criteria.setFetchMode("department", FetchMode.JOIN);
    criteria.add(Restrictions.eq("us.id", unregSalaryId));
    return criteria.list();
}

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

@Override
public List<UnregEmpReligion> getAllDataByUnregSalaryId(Long unregSalaryId) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("unregSalary", "us");
    criteria.setFetchMode("religion", FetchMode.JOIN);
    criteria.add(Restrictions.eq("us.id", unregSalaryId));
    return criteria.list();
}