Return-Path: Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 71496 invoked from network); 31 May 2003 12:58:13 -0000 Received: from web40514.mail.yahoo.com (66.218.78.131) by daedalus.apache.org with SMTP; 31 May 2003 12:58:13 -0000 Message-ID: <20030531125814.63760.qmail@web40514.mail.yahoo.com> Received: from [213.122.113.243] by web40514.mail.yahoo.com via HTTP; Sat, 31 May 2003 13:58:14 BST Date: Sat, 31 May 2003 13:58:14 +0100 (BST) From: =?iso-8859-1?q?Cameron=20Jones?= Subject: mysql, innodb & foreign keys... To: Turbine Torque Users List MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N hi, i'm having some trouble with torque using mysql and innodb tables. i'm trying to add entries to a table with a multiple column primary key. as it's primary key it has one column which is a integer foriegn key and the other is a date. my problem is that when i try to save the object i'm thrown an SQLException: Cannot add a child row: a foreign key constraint fails. i've tried removing the foreign key constraints on the integer column, but keeing the reference in the schema and object classes, but then i'm thrown a ClassCastException on saving when it try's to assign the primary key on the doInsert- it wants a SimpleKey, but finds a NumberKey. it all works fine if i add a primary key column in the table, but it's unnecessary and i'd like to avoid it. on a smaller note, i generate my schema using the jdbc function, but ont doing this it generates blank defaults for all my values. this results in the BaseObjects being created with variable declerations like : int employeeID = ; or, worse, date columns end up as unenclosed strings: Date dateStarted = new Date(00-00-00 : 00000); it's no big problem cause i just go through the schema deleting the defaults, but it gets a bit annoying. any help would be most appreciated. thanks cameron __________________________________________________ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html