-
Notifications
You must be signed in to change notification settings - Fork 180
setHint does not work with updateAllStatement #2404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, TypedQuery.setHint(String, Object) is not meant to pass hints to the SQL server. It is meant to pass hints to Eclipselink itself. If you want to pass hints to the SQL server then put them into the SQL statement. |
Hi @AleksNo , thanks for looking into it. I tried putting the hint into the query and I get an error message:
I also tried the hint before "UPDATE" to no avail. I believe right now my only chance would be to use a native query, which would be a pity. When looking at the source code, to try and understand why my other hints do get passed to the SQL Server (Oracle in my case) but the hint for this specific query does not, I can see that the hint is copied for delete, insert, select and update statements, but not for updateAll. Thus, it looks to me that it is missing. But maybe there is a good reason for that, which I don't understand. SQLDeleteStatement: Line 547 in 87d4b56
Line 562 in 87d4b56
SQLInsertStatement: Line 585 in 87d4b56
SQLSelectStatement: Line 804 in 87d4b56
SQLUpdateStatement: Line 874 in 87d4b56
SQLUpdateAllStatement: missing |
@AleksNo can you please have a look, I'm pretty sure the hint does get passed to the queries for every statement, except the SQLUpdateAllStatement, or am I missing something? |
Hi there, I'm trying to use
setHint
withupdateAllStatement
but the hint does not get copied to the SQL statement.I believe a
updateAllStatement.setHintString(getQuery().getHintString());
is missing around this part:eclipselink/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/queries/ExpressionQueryMechanism.java
Line 846 in 87d4b56
Can someone please confirm?
Here is my code in case anyone is interested:
Cheers,
Fabio
The text was updated successfully, but these errors were encountered: