|Executing arbitrary SQL in the current session [message #688541]
||Fri, 24 June 2011 22:01
| Kevin Pauli
Registered: June 2011
I am new to JPA 2.0/EclipseLink/Glassfish/JEE6, and have kind of a basic question.|
I have a DAO in which most of the entities are mapped directly to columns using JPA annotations, so I use the EntityManager, and it works great with no issues.
However there are some tables in which I am constructing the SQL statements myself b/c they use oracle-specific functions (spatial), and I want very fine-grained control of the SQL. So I am building it with string concatenation. I would like to be able to enroll my SQL executions in the current transaction, if there is one already underway.
So naturally I don't want to go directly to the DriverManager and create my own connection, I was looking for some kind of EntityManager.executeArbitrarySQL(String) function that would find the current connection and make my SQL part of the current transaction. Am I off my rocker?
[Updated on: Fri, 24 June 2011 22:02]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02028 seconds