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

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

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

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

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

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

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

@Override
public Long getTotalSystemLetterReferenceByParam(SystemLetterReferenceSearchParameter parameter) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    doSearchSystemLetterReferenceByParam(parameter, criteria);
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

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

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

@Override
public Long getTotalByParam(Long systemScoringId) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("systemScoring.id", systemScoringId));
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

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

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

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

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

@Override
public Long getTotalByValue(Integer value) {
    Criteria criteria = getCurrentSession().createCriteria(getEntityClass());
    criteria.add(Restrictions.eq("value", value));
    return (Long) criteria.setProjection(Projections.rowCount()).uniqueResult();
}

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

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