-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Lack of setNullParameter() functionality on io.ebean.SqlQuery interface #2619
Comments
Just checking, what's the actual sql in this case? Is it a formula? |
FYI: This change was brought in with ba21eea .. |
Hi @rbygrave, these sqls are SELECT [...] FROM table1 [...] WHERE field1 = :param1 [...] One use case of setting parameter to Regarding ba21eea. I did find this when looking into the code trying to look for an alternative. However, I was not able to see any obvious way to set a null parameter from |
Yeah interesting, in theory we should be using
I see this as a second [related] issue. This is likely an incorrect omission from the API of SqlQuery with the only mitigation is that in theory we should be using |
@rbygrave Not all JDBC drivers will allow to bind null parameters. That was one reason, why we introduced this check. We should have a multi-platform test for this |
Well yes, I get that - hmmm (on one hand it's a regression, on the other hand mutli-platform code would probably like this check in place ... ) @raphaelNguyen What driver / db is being used here that is allowing binding null for this case? What do you think? Hmmm ... |
@rbygrave, I'm using this driver: https://github.com/pgjdbc/pgjdbc, for a postgres database.
If the change has been made for this reason and we have the functionality
|
Ok, that PR adds So roll this out with the view that we should discuss and maybe put those asserts back in. |
Created the ticket there to followup. Closing this one as released 12.16.1 with this change. |
Thank you so much for your time and assistance in this matter, @rbygrave. |
No worries :) 12.16.1 is on it's way to maven central now so you should be able to use that shortly. |
Expected behavior
io.ebean.SqlQuery
interface has a functionality to set null parameter. Prior to ebean 12.15.0,SqlQuery.setParameter
accepts null for the value parameter.Actual behavior
Since ebean 12.15.0, passing null into
SqlQuery.setParameter
triggers a java assertion to usesetNullParameter
instead. However, theSqlQuery
interface does not seem to offer this functionality.Is this a functionality that SqlQuery should have or is there an alternative functionality somewhere that I've missed? I'm making use of the SqlQuery instance returned from io.ebean.Database.sqlQuery().
Steps to reproduce
java.lang.AssertionError: use setNullParameter
Thank you very much for your time and assistance.
The text was updated successfully, but these errors were encountered: