At 13:04 4/08/2001 -0700, you wrote:
>I am sorry shane, I can't really understand your mapping.
Sorry, I should have deleted those items that are commented out for clarity...
I have cut much of the information in the mapping to create simple objects,
an organisation has an address and a FullContactInformation which has an
address and a FullUserInformation; an organisation is pretty much the same
as the FullContactInformation.. The FullUserInformation is as simple as an
address, both are mapped using the ObjectOID as the FK to OrganisationOID
(this is done as a FullUserInformation and address can belong to any type
of object e.g. Organisation, another FullUserInformation..) the
relationship is one to many and not many-many...
The funny thing is that address is always stored correctly whereas
FullUserInformation is not... the next time an update is done Castor
attempts to create FullUserInformation again and a PersistanceException is
thrown...
At the moment I am going to break down the creations etc into smaller
single level mappings until I can spare the time to look into this further...
thanks for your help, much appreciated...
shane
>Why did you declare ContactInformation in FullContactInformation twice, and
>each with a different join key?
>
>Your mapping has two types ContactInformation and UserInformation. But, why
>a field named ContactInformation has type of UserInforamtion?
>
>Why is there an ObjectOID in FullUserInfomation? What does it do? Why would
>it appear as many-key in the ContactInformation field?
>
>When ContactInformation has a relationship to UserInformation, I suppose
>there will be a <field ..><sql many-key="contactOID"/></field> somewhere,
>but there are none.
>
>I hope the above questions would help you find your problem. :)
>
>
>
>Thomas
>
>-----Original Message-----
> >From: shane [mailto:[EMAIL PROTECTED]]
> >Sent: Saturday, August 04, 2001 1:02 AM
> >To: [EMAIL PROTECTED]
> >Subject: Re: [castor-dev] Multilevel relationships
> >
> >have rechecked the cvs and the problem still persists...
> >
> >
> >At 00:50 4/08/2001 -0700, you wrote:
> >
> >>If you have read other mails to [EMAIL PROTECTED] before sending
>yours,
> >>you might notice that there is a mail describing a very similar problem as
> >>yours.
> >>
> >>Please try the cvs, because it should've been fixed.
> >>
> >>
> >>Thomas
> >>
> >>-----Original Message-----
> >> >From: shane [mailto:[EMAIL PROTECTED]]
> >> >Sent: Saturday, August 04, 2001 12:34 AM
> >> >To: [EMAIL PROTECTED]
> >> >Subject: [castor-dev] Multilevel relationships
> >> >
> >> >Hi
> >> >
> >> >
> >> >If a parent object has a child with more children, all are one to many
> >> >relationships, then the child of the parent gets created before the
>parent
> >> >and hence the reference to the parent in that child is not populated
> >> >before its creation in the DB....
> >> >
> >> >I have autostore == true;
> >> >
> >> >Object mapping:
> >> >
> >> >
> >> >The parent Object is fullContactInformation
> >> >
> >> >If I comment out the last three field entries in FullUserInformation
> >> >mapping then FullUserInformation is created correctly with
> >> >FullContactInformation's OrganistaionOID as the reference value, however
> >> >once any of these three are uncommented then it seems like
> >> >FullUserInformation is created then its children then
> >> >FullContactInformation and the true OrganisationOID doesn't not get
>written
> >> >to the DB...
> >> >
> >> >This is not a desirable action, is there a way to fix this, am I doing
> >> >something fundamentally wrong...
> >> >
> >> >If you can help thanks...
> >> >
> >> > <class name="exedra.data.FullContactInformation"
> >> >identity="OrganisationOID" key-generator="HIGH/LOW">
> >> > <description>Properties Map</description>
> >> > <map-to table="Organisation" xml="Organisation" />
> >> > <field name="OrganisationOID" type="integer">
> >> > <sql name="OrganisationOID" type="integer"/>
> >> > </field>
> >> > <field name="Name" type="string">
> >> > <sql name="Name" type="varchar"/>
> >> > </field>
> >> > <field name="Logo" type="string">
> >> > <sql name="Logo" type="varchar"/>
> >> > </field>
> >> > <field name="OrganisationCategoryOID" type="integer">
> >> > <sql name="OrganisationCategoryOID" type="integer"/>
> >> > </field>
> >> > <field name="BusinessTypeOID" type="integer">
> >> > <sql name="BusinessTypeOID" type="integer"/>
> >> > </field>
> >> > <field name="Comment" type="string" >
> >> > <sql name="Comment" type="varchar"/>
> >> > </field>
> >> ><!--
> >> > <field name="ContactInformation"
> >>type="exedra.data.FullUserInformation" >
> >> > <sql many-key="OrganisationOID"/>
> >> > </field>
> >> > <field name="ContactInformation"
> >> >type="exedra.data.FullUserInformation" required="true"
>collection="vector">
> >> > <sql many-key="ObjectOID"/>
> >> > </field>
> >> >-->
> >> > <field name="InternetAddresses" type="exedra.db.jdo.Internet"
> >> >required="true" collection="vector">
> >> > <sql many-key="ObjectOID"/>
> >> > </field>
> >> > <field name="PhoneNumbers" type="exedra.db.jdo.Phone"
>required="true"
> >> >collection="vector">
> >> > <sql many-key="ObjectOID"/>
> >> > </field>
> >> > <field name="Addresses" type="exedra.db.jdo.Address"
>required="true"
> >> >collection="vector">
> >> > <sql many-key="ObjectOID"/>
> >> > </field>
> >> > <field name="OrganisationsWhoHaveMeAsAContact"
> >> >type="exedra.data.Organisation" required="true" collection="vector">
> >> > <sql many-table="ContactsMap" many-key="OrganisationOID"/>
> >> > </field>
> >> > <field name="ContactInformation"
> >> >type="exedra.data.FullUserInformation" required="true"
>collection="vector">
> >> > <sql many-key="ObjectOID"/>
> >> > </field>
> >> >
> >> > </class>
> >> >
> >> >
> >> > <class name="exedra.data.FullUserInformation"
>identity="ContactOID"
> >> >key-generator="HIGH/LOW">
> >> > <description>Properties Map</description>
> >> > <map-to table="Contact" xml="Contact" />
> >> > <field name="ContactOID" type="integer">
> >> > <sql name="ContactOID" type="integer"/>
> >> > </field>
> >> > <field name="FirstName" type="string">
> >> > <sql name="FirstName" type="varchar"/>
> >> > </field>
> >> > <field name="MiddleInitial" type="string">
> >> > <sql name="MiddleInitial" type="varchar"/>
> >> > </field>
> >> > <field name="LastName" type="string">
> >> > <sql name="LastName" type="varchar"/>
> >> > </field>
> >> ><!--
> >> > <field name="OrganisationInformation"
> >> >type="exedra.data.FullContactInformation">
> >> > <sql name="OrganisationOID"/>
> >> > </field>
> >> >-->
> >> >
> >> > <field name="OrganisationOID" type="integer">
> >> > <sql name="OrganisationOID" type="integer"/>
> >> > </field>
> >> >
> >> > <field name="ObjectOID" type="integer">
> >> > <sql name="ObjectOID" type="integer"/>
> >> > </field>
> >> >
> >> > <field name="MainContact" type="boolean">
> >> > <sql name="MainContact" type="bit"/>
> >> > </field>
> >> > <field name="InternetAddresses" type="exedra.db.jdo.Internet"
> >> >required="true" collection="vector">
> >> > <sql many-key="ObjectOID"/>
> >> > </field>
> >> ><!--
> >> > <field name="PhoneNumbers" type="exedra.db.jdo.Phone"
>required="true"
> >> >collection="vector">
> >> > <sql many-key="ObjectOID"/>
> >> > </field>
> >> > <field name="Addresses" type="exedra.db.jdo.Address"
>required="true"
> >> >collection="vector">
> >> > <sql many-key="ObjectOID"/>
> >> > </field>
> >> >-->
> >> > </class>
> >> ></mapping>
> >> >
> >> >-----------------------------------------------------------
> >> >If you wish to unsubscribe from this mailing, send mail to
> >> >[EMAIL PROTECTED] with a subject of:
> >> > unsubscribe castor-dev
> >> >
> >>
> >>-----------------------------------------------------------
> >>If you wish to unsubscribe from this mailing, send mail to
> >>[EMAIL PROTECTED] with a subject of:
> >> unsubscribe castor-dev
> >
> >-----------------------------------------------------------
> >If you wish to unsubscribe from this mailing, send mail to
> >[EMAIL PROTECTED] with a subject of:
> > unsubscribe castor-dev
> >
>
>-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
Phone: (+64 3) 355 2742
Email: [EMAIL PROTECTED]
Web Address: http://www.griggs.co.nz
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev