That looks as though its setup correctly, so what is exactly is the
error that comes up? Or the functionality that isn't working? Is it
generating a stacktrace or is it just not behaving as expected? Again,
this setup should work, it might just depend on what you are looking
for it to do.
-Nick
On Tue, 1 Feb 2005 15:33:00 +0100, Aziz Hammadi <[EMAIL PROTECTED]> wrote:
>
> Sorry Nick! that was a copy-and-paste mistake. The cell depends on
> Sector but it does not work. Here is my real xml file based on the
> folowing model:
>
> Eeprom 1--------------------* EepromBlock 1--------------------*
>
> <class name="EepromCell" identity="id" key-generator="IDENTITY"
> depends="EepromBlock">
> <map-to table="eepromcell"/>
> <field name="id" type="integer">
> <sql name="id" type="integer"/>
> </field>
> <field name="name" type="string" required="true"
> transient="false"
> direct="false">
> <sql name="name" type="char"/>
> </field>
> <field name="value" type="string" required="true"
> transient="false"
> direct="false">
> <sql name="value" type="char"/>
> </field>
> <!-- reference to the parent -->
> <field name="eepromBlock" type="EepromBlock"
> required="true"
> transient="false" direct="false">
> <sql name="EepromBlock_Id"/>
> </field>
> </class>
>
> <class name="EepromBlock" identity="id" key-generator="IDENTITY"
> depends="Eeprom">
> <map-to table="eepromblock"/>
> <field name="id" type="integer">
> <sql name="id" type="integer"/>
> </field>
> <field name="number" type="integer">
> <sql name="number" type="integer"/>
> </field>
> <!-- reference to the parent -->
> <field name="eeprom" type="Eeprom" required="true"
> transient="false"
> direct="false">
> <sql name="Eeprom_Id"/>
> </field>
> <!-- reference to the children-->
> <field name="eepromCell" type="EepromCell"
> collection="array"
> required="true">
> <sql many-key="EepromBlock_id"/>
> </field>
> </class>
> <class name="Eeprom" identity="id" key-generator="IDENTITY">
> <map-to table="eeprom"/>
> <field name="id" type="integer">
> <sql name="id" type="integer"/>
> </field>
> <!-- reference to the children-->
> <field name="eepromBlock"
> type="EepromBlock" collection="array"
> required="true">
> <sql many-key="Eeprom_id"/>
> </field>
> </class>
>
>
> On Tue, 1 Feb 2005 08:47:32 -0500, Nick Stuart <[EMAIL PROTECTED]> wrote:
> >
> > 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
> >
>
>
> -----------------------------------------------------------
> 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