I have this application that allows users to create meetings and add participants to those meetings. I have 2 Tables named Meetings and Participants… I have a meeting browser screen with a group table and i want it to only display the meetings the current user is a participant of and the meetings that the user created.
The jpql i used achieve this was the following:
“select m from agenda$Meeting m join agenda$Participant p on m.id = p.meeting_id.id where m.createdBy = :custom$user or p.name.id = :custom$part”
the above query only works when there is at least one participant in the meeting. how do i make it so that even if there is no participant in the meeting… the meeting still shows up in the meeting browser of the person who created that specific meeting.
Correct JPQL query:
“select m from agenda$Meeting m left join m.participants p where m.createdBy = :session$userLogin or p.id is null or p.user.id = :session$userId"
Metting_ID_ID (field name in DB) - is bad practice.
Please, rename field meeting_id to meeting.
From the point of view of the system logic, you have a reference to the entity, not its id of entity.
meeting.meeting-description!? -> meeting.description.
meeting.date(time)?? start or end & planned or actual ??? -> meeting.plannedStartDate(Time)