c.add(Restrictions.eq("projectVersion.groupId", projectVersion.getGroupId()));
c.add(Restrictions.eq("projectVersion.artifactId", projectVersion.getArtifactId()));
c.add(Restrictions.eq("projectVersion.version", projectVersion.getVersion()));
c.add(Restrictions.eq("source.source", source.getSource()));
c.add(Restrictions.eq("source.metric", source.getMetric()));
c.addOrder(Order.desc("dateLogged"));
List<WarningRecord> matches = hibernateTemplate.findByCriteria(c, 0, 1);
if (matches.isEmpty()) {
return null;
}
return matches.get(0).warningCount();