db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Eade <se...@backstagetech.com.au>
Subject Re: simple reference problem
Date Wed, 04 Feb 2004 21:35:21 GMT
Henrik Vendelbo wrote:

>On two related tables I try to insert new records. On handset there is a
>foreign key enforcing 'consumerid' to refer to a consumer.
>I have tried using handset.setConsumerid() and handset.setConsumer(). In
>either case it fails on the foreign key constraint.
>
>What might be the problem ?
>consumer = new Consumer();
>
>consumer.setFirstName("John");
>
>consumer.setSurname("Doe");
>
>consumer.setHouseNo("25");
>
>consumer.setBirthdate(new Date("01/01/1970"));
>
>consumer.setLanguage((byte)1);
>
>consumer.setCreated(new Date());
>
>consumer.save();
>
>
>handset.setConsumer(consumer) ;
>
>handset.setPhoneNo("0044416886");
>
>handset.setPhoneManufacturer(1);
>
>handset.setPhoneModel(1);
>
>ConsumerHandsetPeer.doInsert(handset);
>  
>
It might be helpful to post your schema.

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au



---------------------------------------------------------------------
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