Use Hibernate Restrictions (i.e. MySQL query) to find template