We have two rules related to relationship mapping that we can really
do well without:
1. A DbRelationship always requires a reverse DbRelationship.
2. A to-many ObjRelationship without a reverse to-one is effectively
read only.
I've done some work on a project where we've used generic persistent
classes, and it occurred to me that while the two things above are
indeed a property of Cayenne runtime, users don't have to worry about
such low level details. Cayenne can automagically add missing reverse
relationships in runtime to the corresponding entities, without user
ever noticing. That simple - don't know why nobody thought of that
before :-)
BTW what makes (2) painless is CayenneDataObject that can store
arbitrary data in it, so a back pointer from toOne side to the toMany
site can be stored. This won't work in case of POJO's (without extra
enhancement), but for normal Cayenne we get that functionality out of
the box.
Any comments on that?
Andrus
This archive was generated by hypermail 2.0.0 : Sun Aug 05 2007 - 06:32:52 EDT