0
votes

I am trying to create an independent project regardless of the type of DB using JPQL's @Query .

How do I implement the syntax below in JPA?

SELECT MY_SEQ.NEXTVAL FROM DUAL
I use nativeQuery as false in @Query. - choding
You probably need to run your query as raw SQL, and as such, you might as well use DUAL. - Tim Biegeleisen
I don't understand. Do you mean it has to be something like this to use as a DUAL? "SELECT d FROM DUAL d". I am asking how to implement this. - choding
There is no DUAL table in JPQL. My guess is that you need a native query, or else find a workaround. - Tim Biegeleisen
Using NEXTVAL in the context of JPA doesn't even make sense, because NEXTVAL has nothing to do with the Java entities sitting behind your JPA layer. - Tim Biegeleisen