Shouldnt the cell contain its parent sector, and not the hard disk? So
you would have something like:
<class name="Cell" depends="Sector">
<field name="sector type="Sector">
<sql name="sector_Id"/>
</field>
</class>
This would make more sense in the hierarchy to have it setup this way.
I've been able to use several levels of dependencies with out any
issues. At least 3 levels deep, and more. I always have a reference
from the parent (HardDisk) to the children (Sectors) and the other way
as well (from the children back to the parent). You didn't supply the
full mapping so I dont know if you have this or not.
-Nick
Be something
On Tue, 1 Feb 2005 12:43:59 +0100, Aziz Hammadi <[EMAIL PROTECTED]> wrote:
>
> I have the following model:
>
> HardDisk 1 ------------* Sector 1 ------------- * Cell
>
> 1) mapping
> HardDisk 1 --------------- * Sector
> using this :
>
> <class name="Sector" depends="HardDisk">
> <field name="hardDisk" type="HardDisk">
> <sql name="hardDisk_Id"/>
> </field>
> </class>
>
> <class name="Cell" depends="Sector">
> <field name="hardDisk" type="HardDisk">
> <sql name="sector_Id"/>
> </field>
> </class>
>
> works.
>
> 2) mapping
> Sector 1 --------------- * Cell
> works using a similar mapping.
>
> 3) While trying to mapp
> HardDisk 1 ------------* Sector 1 ------------- * Cell
> all together I get this exception:
>
> org.exolab.castor.mapping.MappingException: Depends not
> [EMAIL PROTECTED] Cell
>
> The mapping file looks like this (simple):
>
> <class name="HardDisk" >
> </class>
>
> <class name="Sector" depends="HardDisk">
> <field name="hardDisk" type="HardDisk">
> <sql name="hardDisk_Id"/>
> </field>
> </class>
>
> <class name="Cell" depends="Sector">
> <field name="hardDisk" type="HardDisk">
> <sql name="sector_Id"/>
> </field>
> </class>
>
> Does castor provide dependency recursion? I tryed to look at some
> mapping files of some open source code project using castor but none
> of them uses such a hierarchical structure
> despite of the fact that this is a very used model!
> I use castor-0.9.6-RC3.jar
>
> cheers!
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-user
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user