I'm new to JPA and have the below JPA query:
String qry = " SELECT e from Event e"
+ " WHERE e.meeting.meetingDate= :pdate"
+ " AND e.meeting.feedId IN (1,2)"
+ " AND e.status <> 'W'"
+ " AND e.meeting.status ='A'"
+ " AND e.settleStatus is NULL"
+ " AND e.offTime is NULL"
+ " AND e.eventCode >'07:45:00'"
+ " group by e.id";
And I need to add the ORDER BY clause dynamically. I use MySQL and please anybody tell me how to add below condition to my query using JPA.
part to add:
ORDER BY
CASE WHEN m.country_code ='AU' THEN e.timestamp_updated
WHEN m.country_code <> 'AU' THEN e.event_code
END DESC
how to add this query segment in to my JPA query?