cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugi Thordarson <h...@karlmenn.is>
Subject Prefetch nullifies relatinoship?
Date Tue, 12 May 2015 15:02:51 GMT
Hi all.

I have a weird case (using Cayenne 4.0-M2) where if I add a prefetch to a relationship, the
relationship is nullified (will contain nothing). Consider the following code:

SelectQuery<ProductLink> q = SelectQuery.query( ProductLink.class );
q.addPrefetch( ProductLink.PRODUCT_KEY ); // <---- This line is the culprit

List<ProductLink> links = oc().select( q );

for( ProductLink link : links ) {
	System.out.println( link.product() );
}

Without the prefetch, the “product” relationship is properly populated for each “ProductLink”
object, but if I include the prefetch, the relationship is always null.

Any ideas?

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