File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes output EJB query in entity class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "output EJB query in entity class" Watch "output EJB query in entity class" New topic
Author

output EJB query in entity class

K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2627
    
    9

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


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
 
Consider Paul's rocket mass heater.
 
subject: output EJB query in entity class