Using SQL() function in the FROM clause [message #1697907] |
Tue, 09 June 2015 14:08 |
Kamil Chaber Messages: 1 Registered: June 2015 |
Junior Member |
|
|
Hi guys,
I want to mix the JPQL code with some SQL in the following way:
SELECT entity FROM SQL('SELECT * FROM SOME_TABLE') entity WHERE entity.property1 = 1;
Unfortunatelly I'm always getting errors like:
Quote:
The identification variable is not following the rules for a Java identifier: 'SELECT * FROM SOME_TABLE'
How can I achieve such mix? Is it possible at all?
To clarify my intention with mixing JPQL with SQL:
The nested native SQL query is some complex query using inter alia recursive functionality, with clauses which are not available in JPA even in EclipseLink JPA. On the other hand I have a lot of functionality prepared for parsing JPQL queries, such as adding additional criteria etc.. Having the jpql as a main query is very important for me.
|
|
|
Powered by
FUDForum. Page generated in 0.02668 seconds