getArtist().getObjectId() or Cayenne.longPKForObject(getArtist()) actually will not result in a DB round-trip. Cayenne returns a HOLLOW object for simple to-one relationships. So this is the Cayenne way.
If this doesn't work, could you please elaborate why you need a raw FK. Maybe there's another way. Andrus On Mar 6, 2013, at 8:38 PM, David Feshbach <[email protected]> wrote: > Is there any way to get the ObjectId or raw foreign key of a related object > without faulting? I'd like to implement getArtistObjectId() or getArtistPK() > without calling getArtist().getObjectId() or > Cayenne.longPKForObject(getArtist()). > > Thanks, > > David
