Hello all !
I have currently a big problem refreshing my relationships with
cayenne 3.0M6 (tested with M5 too).
I have a table JOB with some extended/dynamic properties and another
related JOB_AUX table (kinda key/value pair table). So there is a
to-many relationship between JOB->JOB_AUX with the flag "To Dep PK" set.
In my JOB editor I display all the extended properties (JOB_AUX), and I
used to use the JOB.addPrefetch(related_JOB_AUX) to ensure that the JOB
and it's relationships are fresh each time I fetch a job in the editor.
I had a problem one day with :
PREFETCH LIMITATION:
To-many relationships should not be prefetched if a query qualifier can
potentially reduce a number of related objects, resulting in incorrect
relationship list.
So I removed the prefetch and tried another way : In my editor I need
fresh data so I used RefreshQuery(JOB) each time a job is selected to be
sure that the related JOB_AUX will be fresh, but it does not work.
The funny thing is that :
- RefreshQuery(JOB) does not see when a value _change_ in the JOB_AUX
table, but works when a value is _added_ or _removed._
- I tried with RelationshipQuery(JOB, related_JOB_AUX, true) but it only
works when a value is _changed_ in the JOB_AUX table it does not when a
value is _added_ or _removed._
So I can make my editor work when I use a combination of these two
queries on the JOB to have fresh data.
Is this a bug ? do you have a Cayenne test case with an embedded
database that I can use to reproduce this case ?
Thanks.
Laurent Marchal.
This archive was generated by hypermail 2.0.0 : Thu Jun 11 2009 - 13:09:35 EDT