I need to be able to find all items in a table where the id of each item is not in a relational mapping table. In other words, I have one table where each row has an id. If that id is in a map table, it should not show up in my list.
I was thinking of querying my map table for all id's in it, then turning around and querying my main table to exclude any items that have that id... so something like:
select * from Main where id not in(select main_id from Map);
Is there a good way to do this with grails either through a findBy method or possibly a criteria builder query?