My xml file for the mapping is as follows :
 
<mapping>
  <!--  Mapping for TradingAccount -->
  <class name="TradingAccountValue"
         identity="personId">
    <description>Trading Account</description>
    <map-to table="TradingAccount" xml="Trading Account" />
    <field name="personId" type="long" >
      <sql name="personId" />
    </field>
    <field name="brokerID" >
      <sql name="brokerId" />
    </field>
    <field name="accountNo">
      <sql name="accountNo" />
    </field>   
    <field name="activate" type="boolean" >
      <sql name="activate" />
  &nbs! p; </field>   
  </class>

  <!--  Mapping for PersonProfile  -->
  <class name="PersonProfileValue"
         identity="userRef">
    <description>Person Profile</description>
    <map-to table="PersonProfile" xml="personProfile" />
    <field name="userRef" type="long" >
      <sql name="personId" />
    <field name="identityNumber" >
      <sql name="identityNo" />
    </field>
    <field name="tradingAccount" type="TradingAccountValue">
      <sql name="personId" />
    </field>   
  </class>
</mapping>
 
 
The personId in the PersonProfile is used as its identity and also to reference the TradingAccount.
 
When trying to create a new record of the PersonProfile , duplicate column name was thrown. After putting some print statement in the SQLEngine, the _sqlCreate statement is :
 
INSERT INTO "PERSONPROFILE" ("PERSONID","IDENTITYNO","PERSONID") VALUES (?,?,?,?,?,?)
 
The duplicate column name is actually refering to the PERSONID which was used twice in the mapping.xml file under the PersonProfileValue class.  Is there anyway do solve this other than creating another column with different name? Thanks.
 
 
 
 
 


Get your FREE download of MSN Explorer at http://explorer.msn.com
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev

Reply via email to