Add temporary constructed inplace rows using datasource with query

Currently I have a custom datasource:

public class EventCardsDatasource extends CustomGroupDatasource<EventCard, UUID> {
    MemberService memberService = AppBeans.get(MemberService.NAME);
    EventsService eventsService = AppBeans.get(EventsService.NAME);

    HashSet<EventCard> eventCards = new HashSet<>();

    public void commit() {
        for(Entity i:itemsToCreate) if(((EventCard)i).getState()==ParticipantEventState.fake){

    protected Collection<EventCard> getEntities(Map params) {

        Card card = memberService.getCurrentMember();
        if (card != null) {
            List<EventCard> ecs = eventsService.getEventCardsOfCard(card, "eventFilterScreen-view");
        List<Event> events = eventsService.getAllEvents(null);
        for(Event e:events){
                EventCard ec = metadata.create(EventCard.class);
        return eventCards;

And instead of if(true) there must be the constraint:
fake EventCard should not be generated for Events for which there are rows already added by eventCards.addAll(ecs); call that contain that event…

See those eventCards with ParticipantEventState.fake must exist in datasource (well in a table to be precise) but mustn’t be committed. But with such datasource filter doesn’t work. How do I achieve the same with datasouce which uses <query> instead of custom DSclass?

Also I can’t use memberService.getCurrentMember(); in JPQL but I can use application attribute stored in DB instead, right?

PS: The getEventCardsOfCard is simply select e from callbook$EventCard e where = :cardId