List of usage examples for org.springframework.dao.support DataAccessUtils longResult
public static long longResult(@Nullable Collection<?> results) throws IncorrectResultSizeDataAccessException, TypeMismatchDataAccessException
From source file:de.forsthaus.backend.dao.impl.CustomerDAOImpl.java
@Override public int getMaxCustomerId() { DetachedCriteria criteria = DetachedCriteria.forClass(Customer.class); criteria.setProjection(Projections.projectionList().add(Projections.max("id"))); long max = DataAccessUtils.longResult(getHibernateTemplate().findByCriteria(criteria)); return (int) max; }
From source file:org.pssframework.dao.BaseHibernateDao.java
public long queryForLong(final String queryString, Object[] values) { return DataAccessUtils.longResult(getHibernateTemplate().find(queryString, values)); }