I'm having a problem with foreign keys in torque. We are trying to
upgrade to Torque 3.1 from an older snapshot build. Maven is handling
the build, using torque:om. With our older version, if we had a foreign
key defined for a given table, a method was generated in the
base<table-name> object that takes an object of the foreign table as an
argument. For example, given the following simple schema:
<table name="CUSTOMER">
<column name="OBJECT_ID" primaryKey="true" required="true"
type="INTEGER"/>
<column name="CUSTOMER_ID" required="true" type="INTEGER"/>
<column name="NAME" required="true" size="40" type="VARCHAR"/>
</table>
<table name="ORDER">
<column name="OBJECT_ID" primaryKey="true" required="true"
type="INTEGER"/>
<column name="ITEM" required="true" size="40" type="VARCHAR"/>
<column name="CUSTOMER_ID" required="true" type="INTEGER"/>
<foreign-key foreignTable="CUSTOMER">
<reference foreign="OBJECT_ID" local="CUSTOMER_ID"/>
</foreign-key>
</table>
two base<table-name> classes would be produced, BaseOrder, and
BaseCustomer. BaseOrder would have a method called getCustomer that
returned a Customer object, and a method called setCustomer(Customer c)
that takes a Customer object as an argument.
After generating my classes using Torque 3.1, this is no longer
happening. When I generate my classes, all Base<table-name> and
Base<table-name>Peer classes are created, but the methods I am used to
seeing for handling foreign-key relationships are gone.
--------------------------------------------
Nathan McMinn
Application Developer
NequalsOne - HealthCare marketing tools
mailto:[EMAIL PROTECTED]
http://www.NequalsOne.com