Skip to content
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

Table Join for sorting in dataGrid breaks row level condition #2372

Closed
dtaimanov opened this issue Oct 17, 2023 · 1 comment
Closed

Table Join for sorting in dataGrid breaks row level condition #2372

dtaimanov opened this issue Oct 17, 2023 · 1 comment
Assignees
Labels
in: data size: M type: bug Something isn't working
Projects

Comments

@dtaimanov
Copy link
Contributor

dtaimanov commented Oct 17, 2023

See https://forum.jmix.ru/t/row-level-rol-i-sortirovka-v-grouptable/1342

Steps:

  1. Download project and role
  2. Run project
  3. Import role and assign to some user
  4. Open "Notes" and sort by "Assigned too"
  5. Click "Refresh"
    ER item with empty assignedTo present in table
    AR item with empty assignedTo absent

Cause

Inner join used instead of left join in case of appearing constraint and sorting simultaneously:

-- constraint: yes,  sorting: no
SELECT .. FROM NOTE WHERE (((ASSIGNED_TO_ID IS NULL) OR (ASSIGNED_TO_ID = ?)) AND (DELETED_DATE IS NULL))
-- constraint: yes,  sorting: yes
SELECT .. FROM USER_ t0, NOTE t1 WHERE ((((t1.ASSIGNED_TO_ID IS NULL) OR (t1.ASSIGNED_TO_ID = ?)) AND (t1.DELETED_DATE IS NULL)) AND (t0.ID = t1.ASSIGNED_TO_ID)) ORDER BY t0.FIRST_NAME ASC, t0.LAST_NAME ASC, t0.USERNAME ASC, t1.ID ASC

-- constraint: no,  sorting: yes
SELECT .. FROM NOTE t1 LEFT OUTER JOIN USER_ t0 ON (t0.ID = t1.ASSIGNED_TO_ID) WHERE (t1.DELETED_DATE IS NULL) ORDER BY t0.FIRST_NAME DESC, t0.LAST_NAME DESC, t0.USERNAME DESC, t1.ID ASC

Workaround

Use explicitly specified left join in role definition (see forum reply)

@dtaimanov dtaimanov added in: data type: bug Something isn't working labels Oct 17, 2023
@knstvk knstvk changed the title Table Join for sorting in dataGrid disturbs row level condition Table Join for sorting in dataGrid breaks row level condition Oct 17, 2023
@gorbunkov gorbunkov added this to Backlog in Release 1.5 via automation Dec 1, 2023
@dtaimanov dtaimanov moved this from Backlog to In progress in Release 1.5 Dec 18, 2023
@dtaimanov
Copy link
Contributor Author

Eclipselink issue eclipse-ee4j/eclipselink#2025 has been reported.

@dtaimanov dtaimanov closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
Release 1.5 automation moved this from In progress to Done Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data size: M type: bug Something isn't working
Projects
Release 1.5
  
Done
Development

No branches or pull requests

2 participants