Better generation for parameters - #237
Conversation
Handle default parameters
|
Thank you for the PR. I'll add JUnit tests to check that, before merging your PR Étienne |
|
FYI, the first part of the PR is ok. Once this is done, I'll release a new version with your PR. Étienne |
|
Thanks for checking and good point – I was only dealing with a case of simple single-token values, so I didn't consider more elaborate ones. Let me know if you need anything from me. |
|
Thanks for the proposal, but impacts are quite huge for this "little" thing. And I'm glad to improve the code, there. BTW, is there any reason why you changed many InputParameter's methods from private to protected ? I'm in the process of setting them back to private. |
|
I made them protected to make it possible to extend the classes and patch functionality without having to replace them. Being private, I have no choice by to replace the class if I need a non-standard feature, but being protected, I can extend the class and override the behavior. In the end, them being protected makes not difference for this PR. |
|
Hello, I commited a complementary update to generalize the use of Default Value. FYI, it was quite a big commit: 60 files were changed. Then, about:
Yes of course. But this method should remain privates, according to me. Nevertheless, I let them as you changed them, as you did this PR. Etienne |
|
Hi Etienne, Apologies for the late answer - been busy with other things. I tested the newest version in master and it seems to work just fine for me. Seems to also solve another issue I've encountered in my version, so that's great. FYI, when compiling master, I noticed it does not compile with Java 25. Works fine with Java 17, though. |
|
Ok, thanks for the PR, the test, and the comment about java 25. |
|
I just released the 3.1 version |
Parameters will null values
A query like this
with parameters
first = 1, last = nullwould generateleading to errors with backends checking parameters are used; this is fixed here.
Parameters with default values
Also, queries with default parameters like this
were not supported; this too has been added.