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 83197 invoked from network); 17 Apr 2003 18:55:39 -0000 Received: from www.webcodex.com (HELO mail.webcodex.com) (209.10.42.23) by daedalus.apache.org with SMTP; 17 Apr 2003 18:55:39 -0000 Received: (qmail 6949 invoked from network); 17 Apr 2003 19:55:42 -0000 Received: from tteam.secdog.com (HELO webcodex.com) (66.150.114.21) by mail.webcodex.com with SMTP; 17 Apr 2003 19:55:42 -0000 Date: Thu, 17 Apr 2003 14:59:31 -0400 Subject: Re: No default values in my Object Model Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: David Hakim To: "Turbine Torque Users List" Content-Transfer-Encoding: 7bit In-Reply-To: <3E9DA983.37D30B6B@minaret.com> Message-Id: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Wednesday, April 16, 2003, at 03:05 PM, Jon King wrote: > This happens because the generated schema can specify defaults for > integer > columns that are empty strings (i.e., default = ""). I'd like to be > able to tell > the jdbc target to supress the generation of defaults but don't know > how to do > this. I end up stripping a lot of the default specification out of > the xml with > a sed script. If you eliminate the empty string defaults for integer > columns, > the object model will build correctly. Interesting ... Under what circumstances does the jdbc target generate 'default=""' for columns in the XML schema ? Is this a driver / database dependent behavior ? When running the jdbc target against existing MSSQL databases I don't get any 'default' attributes in the generated XML schema. When running the jdbc target against MySQL databases I get defaults for every column! With MySQL, does 'default=""' only happen when columns are specified to allow NULLs (and no other specific default is specified) ? To set the default for a column to actually be NULL do I just remove the 'default' attribute ? -Dave > David Hakim wrote: > >> Sorry if this a newbie question but I couldn't find anything >> on it in >> the docs or mail archive. I used torque to generate an XML schema file >> from an existing mysql database. I then generated the object model for >> that database. The object model however will not compile because there >> are syntax errors in the generated base classes: >> >> /** >> * The value for the print field >> */ >> private int print = ; >> >> /** >> * The value for the condition field >> */ >> private byte condition = ; >> >> ... >> >> Any idea what would cause these errors in code generation ? I went >> through the same process with a SQLServer database the other day (even >> though there were a couple hangups there in getting torque to generate >> the XML from the existing mssql schema) however all the generated >> objects output and compiled correctly . >> >> Thoughts ? >> -Dave >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >> For additional commands, e-mail: torque-user-help@db.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > >