hi all,
actually i did tried to have bi-directional relation setup but it still doesnt
work! i think it is my fault to put the code without bi-directional relation.
and actually after trying and trying i found the problem lies on the following
code:
DT> <sql many-table="OGT_USER_BKR_MAP"/>
if the above got removed, the dependent object will be stored in the DB (even
without bi-directional relation)!
just FYI, attached is the working mapping.
regards,
dave
----- Original Message -----
From: "Jeremy Kuhnash" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 03, 2002 03:40
Subject: Re: [castor-dev] JDO: What is the use of keyword 'depends'
> That is the most ridiculous quoting I have ever seen - I love it!
>
>
> -- Jeremy
>
>
>
> ----- Original Message -----
> From: "Bruce Snyder" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 02, 2002 2:18 PM
> Subject: Re: [castor-dev] JDO: What is the use of keyword 'depends'
>
>
> > This one time, at band camp, David Tam said:
> >
> > DT>just want to know the meaning of 'depends'.
> > DT>
> > DT>i have the following mapping:
> > DT>
> > DT>/*********************************************************/
> > DT><mapping>
> > DT> <class name="og_User" access="shared" identity="userId statInd" >
> > DT> <description>just a testing mapping for trying out
> castor</description>
> > DT> <cache-type type="count-limited" capacity="30"/>
> > DT> <map-to table="OGT_USER" />
> > DT> <field name="userId" type="string" required="true">
> > DT> <sql name="USER_ID" type="varchar" />
> > DT> </field>
> <snip>
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
_______________________
CONFIDENTIALITY NOTICE:
This message, together with any attachment, is intended only for the use of the
individual or entity to whom it is addressed and contains information that is
privileged and confidential. If you are not the intended recipient, please be
informed that any dissemination, distribution or reproduction of this message
(including any attachment) is strictly prohibited. If you have received this message
in error, please notify us immediately by return e-mail and delete the original
message. Thank you.
<!DOCTYPE databases PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
"http://castor.exolab.org/mapping.dtd">
<mapping>
<!-- Mapping for TestObject to test_table
Single object mapping, shared access, dirty checking on all fields -->
<class name="og_User" access="shared" identity="userId statInd" >
<description>just a testing mapping for trying out castor</description>
<!-- <cache-type type="count-limited" capacity="30"/>-->
<cache-type type="count-limited" capacity="30"/>
<map-to table="OGT_USER" />
<field name="userId" type="string" required="true">
<sql name="USER_ID" type="varchar" />
</field>
<field name="userNam" type="string" >
<sql name="USER_NAM" type="varchar" />
</field>
<field name="userGrpCde" type="string" >
<sql name="USER_GRP_CDE" type="varchar" />
</field>
<field name="statInd" type="char" >
<sql name="STAT_IND" type="varchar" />
</field>
<field name="relatUserId" type="string" >
<sql name="RELAT_USER_ID" type="varchar" />
</field>
<!-- cannot add these 2 fields because they will be update by triggers
<field name="lastModId" type="string" >
<sql name="LAST_MOD_ID" type="varchar" />
</field>
<field name="lastModTme" type="date" >
<sql name="LAST_MOD_TME" type="date" />
</field> -->
<field name="userPasswd" type="string" >
<sql name=" USER_PASSWD" type="varchar" />
</field>
<!-- if one to one mapping, the sql use many-table and the value is the
table name -->
<field name="userBrokerMaps" type="og_UserBrokerMap" collection="collection" lazy="false"
set-method="setUserBrokerMaps" get-method="getUserBrokerMaps">
<!-- cannot add this if it is a dependent object
<sql many-table="OGT_USER_BKR_MAP"/>
-->
</field>
</class>
<class name="og_UserBrokerMap" depends="og_User" identity="userId mktGrpCde" >
<description>just a testing mapping for trying out castor</description>
<cache-type type="count-limited" capacity="30"/>
<map-to table="OGT_USER_BKR_MAP" />
<field name="userId" type="string" required="true">
<sql name="USER_ID" type="varchar" />
</field>
<field name="mktGrpCde" type="string" required="true">
<sql name="MKT_GRP_CDE" type="varchar" />
</field>
<field name="seqNbr" type="big-decimal">
<sql name="SEQ_NBR" type="numeric" />
</field>
<field name="statInd" type="char">
<sql name="STAT_IND" type="varchar" />
</field>
<!--
<field name="lastModId" type="string">
<sql name="LAST_MOD_ID" type="varchar" />
</field>
<field name="lastModTme" type="date">
<sql name="LAST_MOD_TME" type="date" />
</field>
-->
<!-- if one to one mapping, the sql name is the foreign key -->
<!--
<field name="user" type="og_User">
<sql name="USER_ID STAT_IND" />
</field>
-->
<field name="Broker" type="og_Broker" >
<sql name="BKR_CDE" />
</field>
</class>
<class name="og_Broker" depends="og_UserBrokerMap" identity="brokerCde" >
<description>just a testing mapping for trying out castor</description>
<cache-type type="count-limited" capacity="30"/>
<map-to table="OGT_BKR" />
<field name="brokerCde" type="string" required="true">
<sql name="BKR_CDE" type="varchar" />
</field>
<field name="BrokerName" type="string" >
<sql name="BKR_NAM" type="varchar" />
</field>
<field name="brokerNbr" type="string" >
<sql name="BKR_NBR" type="varchar" />
</field>
<field name="statInd" type="char">
<sql name="STAT_IND" type="varchar" />
</field>
<!--
<field name="lastModId" type="string">
<sql name="LAST_MOD_ID" type="varchar" />
</field>
<field name="lastModTme" type="date">
<sql name="LAST_MOD_TME" type="date" />
</field>
-->
<field name="suspInd" type="char">
<sql name="SUSP_IND" type="varchar" />
</field>
</class>
</mapping>