Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

output EJB query in entity class

 
K. Tsang
Bartender
Posts: 3441
13
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Does anyone know how to print the actual SQL query generated by EJBQL?

Suppose I have query = em.createNamedQuery("bla"); then setParameter for where clause. I can't just System.out.println(query); = this would give the object in string form.

Given bla is like "select a from Account a where a.email=:email and ...";
How to print to give the select format?

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic