cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From emeka okafor <emeka_1...@yahoo.com>
Subject many2many + single table inheritance
Date Sun, 13 Jan 2013 12:46:14 GMT


Hello again,
I have been trying to simplify some parts of my code and so I figured the following will work:

I have a many-to-many relation, say A <<->> Base
Base has two subclasses, say Base1 andBase2 modeled using single table inheritance,
so basically:
<obj-entity name="Base1" superEntityName="Base" className="Base1">

<qualifier><![CDATA[Type = "BASE1"]]></qualifier>
</obj-entity>
<db-relationship name="bases" source="A" target="Base" toMany="true">
<db-attribute-pair source="A_ID" target="BASE_ID"/>
</db-relationship>

I thought that by adding this:

<obj-relationship name="bases1" source="A" target="Base1" db-relationship-path="bases"/>,

in other words: A -> B1, 

Then I would be able to do A.getBases1() to retrieve all of my subclasses instead of always
having to go through A.getBases() and then filter using the discriminator column.
But it is not working. Any idea how to achieve what I am trying to do?
Thanks.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message