cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugi Thordarson <>
Subject Re: Traversing relationships in DataRow queries?
Date Wed, 01 Apr 2015 11:59:30 GMT
>> 1) When fetching data rows, can I limit the set of fields fetched, i.e. is there an
equivalent to EOF’s EOFetchSpecification.setRawRowKeyPaths( NSArray )?
> Not right now. This is doable with EJBQLQuery (it allows to specify individual columns,
aggregate functions, etc). This functionality is coming soon to SelectQuery/ObjectSelect (probably
in M3).

Great! We use EOF a lot for reporting so this will be really helpful performance/memory wise.

>> 2) When specifying the prefetch, why do I have to addPrefetch( A.SOME_REL.joint()
) instead of just doing addPrefetch( “someRel” )? 
> You can still use the String. A.SOME_REL form is an alternative that gives you a compile-time
guarantee that your property name is valid .

Hmm, doesn’t seem to work. This code performs the expected prefetch:

 SelectQuery<DataRow> q = SelectQuery.dataRowQuery( SMReceipt.class );
 q.addPrefetch( SMReceipt.SHOP.joint() );
 List<DataRow> list = q );

While this doesn’t:

 SelectQuery<DataRow> q = SelectQuery.dataRowQuery( SMReceipt.class );
 q.addPrefetch( SMReceipt.SHOP.getName() );
 List<DataRow> list = q );

Should I file a bug report?

>> When traversing further relationships, is this the correct way? :
>> q.addPrefetch( PrefetchTreeNode.withPath( "shop.chain", 1 ) );
> q.addPrefetch( is probably a cleaner way. 

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