Example usage for org.hibernate.criterion Projections rowCount

List of usage examples for org.hibernate.criterion Projections rowCount

Introduction

In this page you can find the example usage for org.hibernate.criterion Projections rowCount.

Prototype

public static Projection rowCount() 

Source Link

Document

The query row count, ie.

Usage

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

@Override
public Long getTotalKlasifikasiKerjaLevelByParam(KlasifikasiKerjaLevelSearchParameter searchParameter) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchByParam(searchParameter, criteria);
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

@Override
public Long getTotalByParam(LoanCanceledSearchParameter searchParameter) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchByParam(searchParameter, criteria);
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

@Override
public Long getCurrentMaxId() {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

@Override
public Long getTotalByParamByStatusUndisbursed(LoanNewSearchParameter parameter) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchByParam(parameter, criteria);
    criteria.add(Restrictions.eq("loanStatus", HRMConstant.LOAN_UNDISBURSED));
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

@Override
public Long getTotalInstallmentByLoanNewApplicationId(Integer loanNewApplicationId) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.setFetchMode("loanNewApplication", FetchMode.JOIN);
    criteria.add(Restrictions.eq("loanNewApplication.id", loanNewApplicationId));
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

@Override
public Long getTotalDataByParam(LoanNewSchemaSearchParameter searchParameter) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchByParam(searchParameter, criteria);
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

@Override
public Long getTotalByLoanNewCode(String code) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("loanSchemaCode", code));
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

@Override
public Long getTotalByLoanNewCodeAndNotId(String code, Long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("loanSchemaCode", code));
    criteria.add(Restrictions.ne("id", id));
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

@Override
public Long getTotalByLoanNewName(String name) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("loanSchemaName", name));
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

@Override
public Long getTotalByLoanNewNameAndNotId(String name, Long id) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("loanSchemaName", name));
    criteria.add(Restrictions.ne("id", id));
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}