cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tad <tadfis...@gmail.com>
Subject Flattened relationship Fault not set when creating new object
Date Mon, 25 Jun 2012 17:50:04 GMT
Hi all,

I have a setup with a relationship like the following:

Slot (to one) Shift (to one) Schedule

In the Modeler, I created a flattened relationship between Slot and
Schedule by traversing the Shift relationship:

<obj-relationship name="schedule" source="Slot" target="Schedule"
db-relationship-path="shift.schedule"/>

In most cases, this works fine. Calling Slot.getSchedule() resolves a
ToOneFault that returns the Schedule object.

The problem I'm having is right after creating a Slot object, assigning it
to a new Shift object via Shift.addToSlots(Slot), then committing the
change. Calling Slot.getSchedule() ends up in
readPropertyDirectly("schedule"), which returns null because the ToOneFault
has not been populated.

After re-querying the Slot, the Schedule field is populated correctly with
a ToOneFault. It is only directly after the Slot/Shift objects are created
and the ObjectContext has committed that this field is missing.

Does this appear to be an error in my setup or procedure, an undocumented
quirk of flattened relationships, or a bug in Cayenne?

Thanks for any help you can give.

-Tad

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