try handset.save()
-----Original Message----- From: Henrik Vendelbo [mailto:[EMAIL PROTECTED] Sent: Mi�rcoles, 04 de Febrero de 2004 03:34 p.m. To: Apache Torque Users List Subject: simple reference problem 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); Cheers, Henrik --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
