Three ways to create query in Hibernate