users@glassfish.java.net

Re: Where are the SQL statements generated of the NamedQueries stored?

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 Feb 2008 15:32:05 PST

> DatabaseQuery dbQuery =
> ((oracle.toplink.essentials.ejb.cmp3.EJBQuery)em.creat
> eNamedQuery("name")).getDatabaseQuery();
> dbQuery.prepareCall(((EntityManagerImpl)em.getDelegate
> ()).getServerSession(), new DatabaseRecord());


This works fine when using em.createNamedQuery(), but gives a IllegalArgumentException when using em.createQuery(). Is there any way to get the database query for an arbitrary JPQL string within your code?
[Message sent by forum member 'edwardrayl' (edwardrayl)]

http://forums.java.net/jive/thread.jspa?messageID=260870