db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Mcminn" <NMcm...@theblragency.com>
Subject RE: Generated class problem
Date Mon, 15 Mar 2004 18:06:20 GMT
Any idea why my installation would be having this problem?

--------------------------------------------
Nathan McMinn
Application Developer
NequalsOne - HealthCare marketing tools
mailto:nmcminn@NequalsOne.com
http://www.NequalsOne.com 

-----Original Message-----
From: Luca Zappa [mailto:luca@lucazappa.com] 
Sent: Saturday, March 13, 2004 4:26 PM
To: 'Apache Torque Users List'
Subject: RE: Generated class problem

Hi Nathan,
  I have genereted (without Maven) your simple schema with Torque 3.1
and
the two methods are included in BaseOrder class (see the attachment).

public Customer getCustomer() throws TorqueException 
public void setCustomer(Customer v) throws TorqueException


Regards,
 Luca

-----Original Message-----
From: Nathan Mcminn [mailto:NMcminn@theblragency.com] 
Sent: Friday, March 12, 2004 6:31 PM
To: torque-user@db.apache.org
Subject: Generated class problem

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:nmcminn@NequalsOne.com
http://www.NequalsOne.com 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message