Hello,
Using Torque 3.1 on Linuz with a MySQL database.
I have a database table layout as follows:
<table name="ALTERNATE_NAME" description="Alternate names"
idMethod="idbroker">
<column name="ALTERNATE_NAME" primaryKey="true" required="true"
type="VARCHAR" size="50"/>
<column name="COMPOUND_ID" required="true" type="INTEGER"/>
<foreign-key foreignTable="COMPOUND" onDelete="cascade">
<reference local="COMPOUND_ID" foreign="UID"/>
</foreign-key>
</table>
When I attempt to populate the table using:
AlternateNamePeer.doInsert(altName); (were altName is of type
AlternateName) it populates the row with a generated number such as 1000
or 1001, not with the value of ALTERNATE_NAME.alternate_name.
If I change the table definition to be:
<table name="ALTERNATE_NAME" description="Alternate names"
idMethod="none">
<column name="ALTERNATE_NAME" primaryKey="true" required="true"
type="VARCHAR" size="50"/>
<column name="COMPOUND_ID" required="true" type="INTEGER"/>
<foreign-key foreignTable="COMPOUND" onDelete="cascade">
<reference local="COMPOUND_ID" foreign="UID"/>
</foreign-key>
</table>
I am able to add as many "ALTERNATE_NAME" rows as I want, but I cannot
udate the ALTERNATE_NAME.alternate_name column.
How should I go about doing this? Are you allowed to update primary
keys using torque and MySQL??
Thank you,
chris.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org
|