Hi Andrus,

We will do the migration during the summer, so it depends how long is « soon » 😀

We built our apps as a burger with a lot of abstract classes on the main(s) 
framework to be sure that every (upper) frameworks know about each other 
classes even if not (really) implemented.

As an example,

We have (abstract) classes called « AbstractCompany » and « AbstractCustomer » 
on the main framework

On the middle commercial framework we implement classes « Invoice » and « Quote 
» that are linked to « AbstractCompany » and « AbstractCustomer ».

And… on the « e-business » framework we do implement the classe « Customer » 
(that extends « AbstractCustomer »)

And… on the « crm » framework we do implement the classe « Company » (that 
extends « AbstractCompany »)

So without any effort, the « Invoice » and « Quote » are able to 
see/select/link « customer » and « company », just with adding the framework(s) 
to the (final) customer app.

I don’t know if it’s clear enough but I hope it may help to understand the 
importance of horizontal inheritance as we can’t rewirte all our logic.

Jérémy

Le 13 avr. 2019 à 16:45, Andrus Adamchik 
<and...@objectstyle.org<mailto:and...@objectstyle.org>> a écrit :

Hi Jérémy,

Yes, there's still no horizontal inheritance in Cayenne. It wasn't attractive 
from performance standpoint, so nobody really advocated for it to happen so 
far. Now that I've finally met a number of people who care about "horizontal", 
we are thinking of prioritizing it. So it may happen (relatively) soon.

Is the game over ?

Not really. You can just map all those tables as separate entities. Queries may 
be a little more annoying to write (especially if you have relationships *to* 
the base abstract entity), but it shouldn't be a show stopper. And outside of 
persistence operations the objects can all implement a single interface, so 
once you get them out of DB, you'll have the ability to treat them as children 
of a single ancestor.

Andrus



On Apr 13, 2019, at 4:26 PM, Jérémy DE ROYER 
<jeremy.dero...@ingencys.net<mailto:jeremy.dero...@ingencys.net>> wrote:

Hello,

I’m trying to migrate (eo)models using horizontal inheritance (over multiple 
frameworks) but without any success : it’s not possible to generate the Java 
classes using Cayenne Modeler.

I did a test with only one entity (and table) : that works great (and easy).

I’ve created a second entity (and  table) : that works great and easy.

I’ve set up an horizontal inheritance between the two entities (and table) : 
Cayenne forces me to use the same table for both entities

In the 3.0's doc, I’ve read : “As of this writing Cayenne does not support 
horizontal inheritance. It may in the future”.

Is it still true in the 4.0 ? 4.1 ? Is the game over ? (as I can not use 
vertical inheritance) 🤕

Thank’s,

Jérémy


Reply via email to