Update queries to use Hibernate