cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: Queries with multiple tables and results
Date Tue, 22 May 2012 15:36:07 GMT
Hi Pierre,

If you want actual Java objects back (Table1 and Table2), you could do
a normal SelectQuery(Table1.class) and add a prefetch to Table2 to
efficiently read those records in:

http://cayenne.apache.org/doc/prefetching.html

Of course, this will read in all records from Table1 and Table2, which
may be a big memory footprint.

mrg


On Tue, May 22, 2012 at 10:56 AM, pk_cayenne <pierre.kouvel@uhb.fr> wrote:
> Hi Emerson,
>
> I try the Option 2  and the result return a list of *DataRow *(which
> contains my  expected values)
>
>         SQLTemplate query = new SQLTemplate(Table1.class,sql);
>          query.setFetchingDataRows(true);
>          List <DataRow> rows =(List <DataRow>) context.performQuery(query);
>
>
> Best Regards.
>
> --
> View this message in context: http://cayenne.195.n3.nabble.com/Queries-with-multiple-tables-and-results-tp4006413p4006810.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.

Mime
View raw message