cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Huss <johnth...@gmail.com>
Subject Re: Specifying what columns to fetch when using DataRows
Date Wed, 19 Oct 2011 14:44:24 GMT
Read here <http://cayenne.apache.org/doc/data-rows.html>.  "Data rows don't
have all the object-oriented features of DataObjects. *In particular, data
rows don't support relationships*."

John

On Wed, Oct 19, 2011 at 6:46 AM, Hugi Thordarson <hugi@karlmenn.is> wrote:

> Hi all.
>
> I'm using DataRow fetching to optimize some queries. How do I specify what
> columns to fetch? Can I do something like this:
>
> --------
> SelectQuery q = new SelectQuery( Person.class );
> q.setFetchingDataRows( true );
> q.setDataRowKeyPaths( Arrays.asList( "name", "department.name",
> "address.city.country" ) );
> --------
>
> For those familar with EOF, I'd do this to achieve the same result:
>
> --------
> EOFetchSpecification fs = new EOFetchSpecification( "Person", null, null );
> fs.setFetchesRawRows( true );
> fs.setRawRowKeyPaths( Arrays.asList( "name", "department.name",
> "address.city.country" ) );
> --------
>
> Cheers,
> - hugi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message