On 23/03/12 2:40 AM, Schönfisch, Jörg wrote:
Hi everybody,
I'm trying to create a model which uses multiple levels of inheritance. Because
of this, I use many (flattened) 1:n-relationships between tables and subtables.
Unfortunately, this results in read-only relationships on deeper levels of the
hierarchy.
Is there any possibility to establish such a read-only relationship with
Cayenne? Otherwise the model is practically unusable as I have no existing data
and solely want to create it through the ORM.
I wonder if there is any practical reason why flattened relationships are
read-only? Or is only the implementation to handle these lacking? Technically
it should be possible to make them writable, at least if the flattened
relationship spans only foreign key constraints.
Since you have a special knowledge of your schema that Cayenne doesn't, perhaps
you can write your own helper methods which know how to create the intermediate
tables and all their required attributes. If the intermediate tables contain
only foreign keys and nothing else, then Cayenne could potentially do what you
want. But that often isn't the case.
Ari
--
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A