cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Get ObjectId of To-One Relationship Without Faulting
Date Thu, 07 Mar 2013 08:43:04 GMT
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


On Mar 6, 2013, at 8:38 PM, David Feshbach <> 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

View raw message