Try something like:
Code:
public int getWipCountFor(final Land land) {
Integer count = (Integer) getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException, SQLException {
Query query = session.createQuery("select count(*) from Cities c where c.land = :land");
query.setParameter("land", land);
return query.uniqueResult();
};
});
return count.intValue();
}