-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
buildSpecification returns duplicate rows when combined with ManyToMany In Criteria #10031
Comments
Ping @gzsombor |
@yelhouti : I find the time to test and confirm this. Sorry for the big delay. Do you know how to improve this ? In this case, do you want to contribute for that ? |
This issue is stale because it has been open 30 days with no activity. |
i have same issue. it is resolved? |
This problem persists in ver 7.0.0.beta-1 |
Quick solution in generated code from jhipster is possible. For generation tool don't know. But it would by nice to have this implemented by default in generated code. Of course with option to turn it on / off. |
Nice solution! Thanks a lot.
|
@pascalgrimaud Hi Pascal, I ran into the same problem and found there was solution for this closed issue, should it be reopened and fixed? Thanks. |
@iconben : sure :-) |
This issue is stale because it has been open 30 days with no activity. |
is here stil some problem? I found out that the current generator generates code with distint enabled by filter parameter with name 'distinct'.
|
@iconben Are you available to do a PR? |
@mraible @mshima @gzsombor What do you think about this 2 solutions? Should we proceed with a fix?
|
@gzsombor What do you think about this solution? |
@DanielFran Hi Daniel, I suggest the 'distinct' filter already do the job. What do you think? |
There is a distinct filter in criteria. |
Overview of the issue
When we have a ManyToMany relationship, a request to the server with
groupId.in=1,2,3
returns the rows with groupIds as many time as present in the filter.ex:
JDL
If Task 1 has groups: 1,2,3,4
and a request is sent with
groupId.in=1,2,3
the line is shown 3 times as there is no distinct in the code that build the specification:io.github.jhipster.service.QueryService<>.buildSpecification
.Motivation for or Use Case
Be able to list all entities linked to other entities, in my example, all tasks in some specific groups.
Reproduce the error
Related issues
Suggest a Fix
buildSpecification
ahould have "an optional parameters" and when set to true calls, query.distinct(true)A more genreic solution would be to add a parameter queryFunction that is applied to query, which would allow to set multiple orders...
JHipster Version(s)
6.1.2, not a regression
JHipster configuration
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
The text was updated successfully, but these errors were encountered: