Having installed Hibernate Tools in Eclipse, how can I view the would-be generated SQL query of from the JPA query language? (I'm using Hibernate as my JPA implementation)
My Java DAO class looks something like:
public List<Person> findById(int id)
{
return entityManager.find(Person.class, id);
}
public List<Person> find(String name)
{
Query q = entityManager.createQuery("SELECT p FROM Person p WHERE name=?");
q.setParameter(1, name);
return q.getResultList();
}
I want to see what the corresponding SQL query will be. I've heard that Hibernate Tools has some kind of support for this.