I keep getting database errors with repeated field names in the select list

When you set up a OneToMany or ManyToOne composition relationship, don't include the foreign key field in the list of properties for either the parent or the child table.

For example, this would be bad configuration:

<object name="Order">
   <id name="id" type="numeric" />
   <property name="fkiduser" type="numeric" />
   <onetomany name="User">
      <link column="fkiduser" to="user.User" />
   </onetomany>
</object>

As you can see the fkiduser foreign key is used twice, which is not what you want.

This would be correct:

<object name="Order">
   <id name="id" type="numeric" />
   <onetomany name="User">
      <link column="fkiduser" to="user.User" />
   </onetomany>
</object>

category Categories:
 
Download in other Formats:
markup Markup | pdf PDF | swf SWF | html HTML