use of org.jbei.ice.storage.model.Audit in project ice by JBEI.
the class AuditDAO method getHistoryCount.
public int getHistoryCount(Entry entry) {
try {
CriteriaQuery<Long> query = getBuilder().createQuery(Long.class);
Root<Audit> from = query.from(Audit.class);
query.select(getBuilder().countDistinct(from.get("id"))).where(getBuilder().equal(from.get("entry"), entry));
return currentSession().createQuery(query).uniqueResult().intValue();
} catch (HibernateException e) {
Logger.error(e);
throw new DAOException(e);
}
}
Aggregations