On the EOF/Wonder world we have ERXExistsQualifier. I don't know how different cayenne is but it might be worth looking at it and try to mimic it.
For example, if you have a Family entity. a Pet entity and a pets to-many relationship from family to Pet then you would be able to build qualifiers than answer questions like these: Get families with pets Get families with zero pets Get families with puppies (where puppies is a sub qualifier on the Pet entity) Etc... The qualifiers work in memory or database equally well. > On Jul 24, 2015, at 12:56 PM, Hugi Thordarson <[email protected]> wrote: > > Indeed :). I’ve been looking at the Expression classes for a while now and > they look a little daunting. Any recommendations on where to start? Is there > a developer guide or an annotated example implementation somewhere? > > - hugi > > > >> On 24. júl. 2015, at 15:59, Andrus Adamchik <[email protected]> wrote: >> >> Classic open source - "scratch your own itch" :) >> >> >>> On Jul 24, 2015, at 6:54 PM, Hugi Thordarson <[email protected]> wrote: >>> >>> Thanks Andrus, we’ll revert to EJBQL for now. >>> >>> Looks like an excellent opportunity to try and implement my first >>> Expression class :) >>> >>> - hugi >>> >>> >>> >>>> On 24. júl. 2015, at 15:36, Andrus Adamchik <[email protected]> wrote: >>>> >>>> We should add it. For now OUTER JOIN should do the trick: >>>> >>>> "a.paintingArray+ = null" >>>> >>>> Also EJBQL syntax supports "IS [NOT] EMPTY" : >>>> >>>> "SELECT a FROM Artist a WHERE a.paintingArray IS EMPTY" >>>> >>>> Andrus >>>> >>>>> On Jul 24, 2015, at 5:51 PM, Hugi Thordarson <[email protected]> wrote: >>>>> >>>>> Hi all. >>>>> Does Cayenne have an Expression class that allows searching for objects >>>>> with an empty to-many relationships? If not, any pointers towards a >>>>> sensible approach? >>>>> >>>>> Cheers, >>>>> - hugi >>>>> >>>>> // Hugi Thordarson >>>>> // http://www.loftfar.is/ <http://www.loftfar.is/> >>>>> // s. 895-6688 >
