cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: ColumnSelect API + Persistent objects
Date Mon, 13 Mar 2017 06:57:50 GMT

>>> 
>>> List<Object[]> result = ObjectSelect.query(Artist.class)
>>>       .columns(Artist.ARTIST_NAME, Artist.PAINTING_ARRAY)
>>>       .select(context);


>> For me it's not clear when do we need direct List result for toMany
>> relationship instead of using Prefetch (or even selecting related
>> entities explicitly).

Let's ponder on this some more. In the example above there are two possible result mappings
of to-many - each cell at index 1 can store either (1) a List<Painting> or (2) a Painting.
Of course in the second case Artist name at index 0 will be repeated for each painting of
a given Artist (so the result is flattened). 

In the proposed solution we throw in the first case and support the second. I'd like to hear
opinions on the usefulness of either of the cases, and maybe some real life examples.

Andrus


Mime
View raw message