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

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

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

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

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

@Override
public List<UnregGoljab> getAllDataByUnregSalaryId(Long unregSalaryId) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.createAlias("unregSalary", "us");
    criteria.setFetchMode("golonganJabatan", FetchMode.JOIN);
    criteria.add(Restrictions.eq("us.id", unregSalaryId));
    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  ww. j a  va  2  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 UnregSalary getEntityByPkWithDetail(Long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("id", id));
    criteria.setFetchMode("wtPeriode", FetchMode.JOIN);
    return (UnregSalary) criteria.uniqueResult();
}

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

@Override
public List<WtFingerException> getByParamWithDetail(WtFingerExceptionSearchParameter searchParameter,
        int firstResult, int maxResults, Order order) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearch(searchParameter, criteria);
    criteria.setFetchMode("empData.employeeType", FetchMode.JOIN);
    criteria.addOrder(order);/*from  w w w. ja  va 2  s.c o m*/
    criteria.setFirstResult(firstResult);
    criteria.setMaxResults(maxResults);
    return criteria.list();
}

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

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

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

@Override
public WtGroupWorking getByPKIdWithDetail(Long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("id", id));
    criteria.setFetchMode("wtScheduleShifts", FetchMode.JOIN);
    criteria.setFetchMode("empDatas", FetchMode.JOIN);
    return (WtGroupWorking) criteria.uniqueResult();
}

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

@Override
public List<WtHoliday> getListPublicNonReligionHolidayBetweenDate(Date start, Date end) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.setFetchMode("religion", FetchMode.JOIN);
    criteria.add(Restrictions.ge("holidayDate", start));
    criteria.add(Restrictions.le("holidayDate", end));
    criteria.add(Restrictions.isNull("religion"));

    return criteria.list();
}

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

@Override
public WtOverTime getEntityByPkFetchApprovalDefinition(Long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.setFetchMode("approvalDefinitionOTs", FetchMode.JOIN);
    criteria.setFetchMode("approvalDefinitionOTs.approvalDefinition", FetchMode.JOIN);
    criteria.add(Restrictions.eq("id", id));
    return (WtOverTime) criteria.uniqueResult();
}