to-one id without fetching row

Tore Halset <[email protected]> Thu, 18 Sep 2025 10:38:00 +0200
Newsgroups gmane.comp.java.cayenne.user
Message-ID <[email protected]>
Hello.

With the following many-to-on relationship: Painting<<-->Artist. There is an ARTIST_ID column in the PAINTING-table.

Having one Painting object, is it possible to get the ARTIST_ID value from the painting row without fetching the Artist? Normally, I would just follow the painting.getArtist().getId(), but for this case, I just want the artist id for performance reasons.

I have tried to just map up artistId in the ObjEntity of Painting, but that returned just null. I have also tried readPropertyDirectly, but do nok know how to extract the ARTIST_ID from that.

 - Tore.