Skip to content

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

Closed
@keshavsahuzellis

Description

@keshavsahuzellis

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions