If you are having a problem with your JPA queries and you are trying to understand what SQL queries it actually sends below the covers you can configure the JPA runtime to show the actual SQL statements it sends over. How? Well for EclipseLink you would add the following to your persistence.xml file.
<property name="eclipselink.logging.level" value="FINEST"/>...
on Oct 27, 2013
OK, native queries in JPA. Not really well documented. Of course I understand that we really should not be doing that, but hey there are times where it is just plain easier.
The following code snippet goes after an Oracle sequence and gets the value.
EntityManager em = this.getEntityManager();Query query = em.createNativeQuery("SELECT BLOG_ITEM_SEQ.nextval FROM DUAL");Vector blogItemRow...
on Aug 22, 2007