TopLink generates the SQL dynamically during runtime. Although TopLink can cache the statements they are not really 'stored' anywhere. The easiest way to view the SQL is to turn on logging using the "toplink.logging.level" "finer" persistence unit properties. To get the SQL within your application you can call.
[code]
DatabaseQuery dbQuery = ((oracle.toplink.essentials.ejb.cmp3.EJBQuery)em.createNamedQuery("name")).getDatabaseQuery();
dbQuery.prepareCall(((EntityManagerImpl)em.getDelegate()).getServerSession(), new DatabaseRecord());
dbQuery.getSQLString();
[/code]
--Gordon
[Message sent by forum member 'gyorke' (gyorke)]
http://forums.java.net/jive/thread.jspa?messageID=259588