Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 99431 invoked from network); 4 Feb 2004 21:38:34 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Feb 2004 21:38:34 -0000 Received: (qmail 32549 invoked by uid 500); 4 Feb 2004 21:37:58 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 32517 invoked by uid 500); 4 Feb 2004 21:37:57 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 32389 invoked from network); 4 Feb 2004 21:37:56 -0000 Received: from unknown (HELO mail.iinet.net.au) (203.59.3.36) by daedalus.apache.org with SMTP; 4 Feb 2004 21:37:56 -0000 Received: (qmail 5425 invoked from network); 4 Feb 2004 21:35:25 -0000 Received: from unknown (HELO turnip) (203.217.17.173) by mail.iinet.net.au with SMTP; 4 Feb 2004 21:35:25 -0000 Message-ID: <40216599.50002@backstagetech.com.au> Date: Thu, 05 Feb 2004 08:35:21 +1100 From: Scott Eade User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Torque Users List Subject: Re: simple reference problem References: <01b401c3eb4d$665c9ae0$7e001e0a@Avatar> In-Reply-To: <01b401c3eb4d$665c9ae0$7e001e0a@Avatar> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 3/02/2004), Outbound message X-Antivirus-Status: Clean X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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