On Mon, Mar 13, 2017 at 3:05 PM, Aristedes Maniatis <a...@maniatis.org> wrote: > On 13/3/17 9:53pm, Andrus Adamchik wrote: >> >>> On Mar 13, 2017, at 1:46 PM, Aristedes Maniatis <a...@maniatis.org> wrote: >>> >>> >>> Just a wild thought, but would this syntax be helpful... >>> >>> List<Object[]> result = ObjectSelect.query(Artist.class) >>> .addColumns(Artist.PAINTING_COUNT) >>> .select(context); >>> >>> So then we are adding more columns to the existing DataObject query rather >>> than having to define the DataObjects as properties in themselves. The >>> syntax above might be simpler to understand and write. >> >> So "addColumns" vs "columns"? IIRC we tried something similar with orderings >> (override all orderings vs add to the existing orderings), and that confused >> everybody (including me as the author), so that was undone between the >> milestones. > > > Except in this case it is very different result since with this syntax you > get the mixed columns/DataObject results and avoid needing to create > properties for 'self' or some other confusing construct. >
I think we can add Property<EntityType> SELF to default cgen templates, then everything will be pretty simple: ObjectSelect .columnQuery(Artist.class, Artist.SELF, Artist.PAINTING_ARRAY.count()) .select(context); -- Best regards, Nikita Timofeev