Closed ckosmowski closed 3 years ago
Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
i.e:
public void updateByTitleInListAndActiveTrue(List<String> title, String fieldToUpdate1, String fieldToUpdate2);
This results in an implemented method that yields a broken SQL Statement containing a comma behind the first question mark:
UPDATE `Table` SET `fieldToUpdate1`=?, WHERE (title IN(?,?) AND valid = TRUE )
We tried to workaround this by two methods like this, and executing them one after the other:
public void updateByTitleInListAndActiveTrue(List<String> title, String fieldToUpdate1); public void updateByTitleInListAndActiveTrue(List<String> title, String fieldToUpdate2);
This results in a broken query like this
UPDATE `Table` SET WHERE (title IN(?,?) AND active = TRUE )
Using a custom query with @Query also seems to be no solution, because we cannot use Lists and the in() statement in there.
So the question is how to update multiple fields in multiple certain rows identified by a list in a batch.
Relates to #690
Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
Task List
Steps to Reproduce
Expected Behaviour
i.e:
This results in an implemented method that yields a broken SQL Statement containing a comma behind the first question mark:
We tried to workaround this by two methods like this, and executing them one after the other:
This results in a broken query like this
Using a custom query with @Query also seems to be no solution, because we cannot use Lists and the in() statement in there.
So the question is how to update multiple fields in multiple certain rows identified by a list in a batch.
Environment Information
Example Application