This content has been marked as final. Show 4 replies
Oh and sorry - we are using Toplink 10g (188.8.131.52)
At this point I believe you are limited to providing the full SQL in your named query. There is not a way to use the query/expression API to specify that this additional hint should be appended.
The following is what you need to do to get the actual SQL that TopLink will send (regardless of query type, binding or no binding), and then modify it:
SQLCall call = request.getCall();
String sql = call.getSQLString();
call.setSQLString(sql + " " + HINT);
The vectorOfQueryArgs is the collection of arguments needed to execute the query - this can be an empty Vector if the query doesn't take any. Since the query has been prepared already, SQL string changes can be set on the SQLCall itself to save TopLink having to create a new SQLCall object and parse the string.
I was missing the prepare stuff. I am able to append my hint now. Thanks for the help!