Closed chentopf closed 11 months ago
Hello,
the additional brackets around the single comparisons, Id = 33, are not generated by the JPA Processor, but by the JPA implementation itself, so EclipseLink or Hibernate.
I saw that behavior by different tools/frameworks generating SQL. To be honest I never investigated why they are doing so. I assume that a generation of brackets around everything is a simple way to ensure that the sequence method calls (so here the calls of the criteria builder methods) are converted correctly into SQL, especially in case the WHERE clause becomes more complex.
Due to clean-up action. All issues created before 2022 get closed.
Hi If i am calling /Projects?$filter = Id eq 33 or Id eq 34 The query generated looks like: select from projects where ((Id = 33) or (id =34)) In a very complex query with many 'OR' this could cause problem. The correct query should be something like this: select from projects where (Id = 33 or id =34)