public Object findExactOne(Session session, String query, String id) throws Exception
{
Object res = session.createQuery(query).setString("id", id).uniqueResult();
if (res == null)
{
throw new ObjectNotFoundException("Cannot find the object with id: " + id);
}
return res;
}