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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 1963
    
    7

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: output EJB query in entity class
 
Similar Threads
Join as well as Criteria Query
SQL query
class name in choices.txt
[ASK] JDBC driver for DBF file, opensource
Regular Expressions in String.split()