cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramiro Aparicio <ramiro.apari...@prot-on.com>
Subject Vertical inheritance with relationships
Date Wed, 19 Sep 2012 15:24:17 GMT
Hello,

I am struggling with some problems mapping vertical inheritance clases:

I have 5 classes in my business model:

Session
ClientSession inherits from Session
WebSession inherits from Session
User
Device

Using vertical inheritance I have all 5 tables and I have no problem 
mapping ClientSession and WebSession attributes but ClientSession has a 
many to one relationship with Device and the same happens with 
WebSession and User.
Using flattened relationship I can map that relation it is read only, 
this should be no problem as long as I can create the relationship from 
the other side, the problem is that in this case there is no reverse 
relationship.
If I try to creat a entity relationship on User I must set the target to 
Session entity and not WebSession, if I set it to WebSession tells me 
there is no mapping and if I choose the correct mapping to WebSession 
then as there is no entity linked to that table it complains about no 
target entity.

I have modelled it as the documentation says setting table/view of 
ClientSession and WebSession to Session table.

As a result it seems the only way to set the relationships is using 
addSession over User/Device to add Session object but this for sure is 
not an easy setup, not documented  and I don't know how it will react if 
I add the wrong session type.
Indeed I am unsure about all this model working as I am under heavy 
refactoring in my application and I wont be able to test the setup in 
the short term.

I am unsure if this is a rant message or a help me I am going crazy one, 
but if some one with some experience with this kind of mapping can share 
some light it will be great.

BTW I tried to do everything with 3.0.2 modeller and finally updated to 
3.1.B1 modeller, Will the model created with 3.1.B1 modeller work with 
3.0.2 runtime? (I want to update the runtime but just in case I can not 
do it).

Ramiro Aparcio

Mime
View raw message