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

Expand not working on Some Child entity when Main Entity is Composite Primary Key. #397

Open
keshavsahuzellis opened this issue Oct 18, 2024 · 0 comments

Comments

@keshavsahuzellis
Copy link

keshavsahuzellis commented Oct 18, 2024

Issue :
http://localhost:8080/xxx/odata/**ScheduleRuns**?$expand=SchedulerRunMessages
image

If you see ScheduleRuns is a Composite Primary and we are applying expand on SchedulerRunMessages, the result which we receive is shown below.
image
Actually it should return SchedulerRunMessages list first record value which is empty but in db value is present .

This issue happens when we add Pagination for entity ScheduleRuns.

Query without Pagination :
select
distinct srm1_0.RunMessage,
srm1_0.ScheduleId,
srm1_0.MessageSeqNo,
srm1_0.ScheduleRunMessageId,
srm1_0.RunTimestamp
from
tx.vi_ScheduleRun sr1_0
join
tx.ScheduleRunMessage srm1_0
on sr1_0.RunTimestamp=srm1_0.RunTimestamp
and sr1_0.ScheduleId=srm1_0.ScheduleId
order by
2,
5

Query with Pagination :
select
distinct srm1_0.ScheduleId,
srm1_0.RunMessage,
srm1_0.RunTimestamp,
srm1_0.MessageSeqNo,
srm1_0.ScheduleRunMessageId
from
tx.vi_ScheduleRun sr1_0
join
tx.ScheduleRunMessage srm1_0
on sr1_0.RunTimestamp=srm1_0.RunTimestamp
and sr1_0.ScheduleId=srm1_0.ScheduleId
where
(
sr1_0.RunTimestamp>=?
and sr1_0.ScheduleId=?
or sr1_0.ScheduleId>?
)
and (
sr1_0.RunTimestamp<=?
and sr1_0.ScheduleId=?
or sr1_0.ScheduleId<?
)

order by
1,
3,
5

Failure Reason : where condition Key boundary condition .

Temporary fix :
In JPANavigationRequestProcessor.java class a below condition have been applied.
image

@keshavsahuzellis keshavsahuzellis changed the title Expand not working on Child entity when Main Entity is Composite Primary Key. Expand not working on Some Child entity when Main Entity is Composite Primary Key. Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant