Forums de discussion

Inheritance in service.xml?

thumbnail
Tamás Sallai, modifié il y a 13 années.

Inheritance in service.xml?

Junior Member Publications: 44 Date d'inscription: 17/09/09 Publications récentes
Hi all,

is there any way that I can map inheritance into service.xml? I need a Component entity, and 2 types of components, each have attributes and the Component has the common attributes.

The hard way is a one-one relationship from the different components to the Component entity, but I'm looking for a solution more like that is in JPA.

Thanks in advance,
sashee
thumbnail
Jakub Liska, modifié il y a 13 années.

RE: Inheritance in service.xml?

Regular Member Publications: 187 Date d'inscription: 25/03/10 Publications récentes
Hi Tamas,

I also need an answer for this question. Did you find a way to deal with this paradigm ? I have an Entity "Account" and two child entities "ProviderAccount" and "CustomerAccount" which share more than a half of the Account properties. I don't know what approach to choose. One possible option is to create a Single table with a discriminator column that would be always checked to differentiate entities.
thumbnail
Tamás Sallai, modifié il y a 13 années.

RE: Inheritance in service.xml?

Junior Member Publications: 44 Date d'inscription: 17/09/09 Publications récentes
Hi,

sadly, no, I haven't found a solution. The best approach seems to have uuid-s associated with all child classes and when querying for any of them then use the uuid, then union the result. It would be nice to have inheritence in a future release.

sashee