Return-Path: Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 46187 invoked by uid 500); 13 Aug 2003 16:30:42 -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 46166 invoked from network); 13 Aug 2003 16:30:41 -0000 Received: from bdsl.66.14.129.196.gte.net (HELO echosuite.com) (66.14.129.196) by daedalus.apache.org with SMTP; 13 Aug 2003 16:30:41 -0000 Received: (qmail 9162 invoked from network); 13 Aug 2003 16:30:44 -0000 Received: from jodda.echospace.com (HELO echospace.com) (192.168.1.44) by seatac.echospace.com with SMTP; 13 Aug 2003 16:30:44 -0000 Message-ID: <3F3A67B5.4020201@echospace.com> Date: Wed, 13 Aug 2003 09:30:45 -0700 From: Ryan Christianson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Torque Users List Subject: hypersonic primarykey's References: <000801c35cef$336d5c10$350614ac@CCIDOMAIN.NET> <016301c35cf0$0899f600$0200a8c0@andras> In-Reply-To: <016301c35cf0$0899f600$0200a8c0@andras> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I had some problems with primary keys with hypersonic. I fixed my issue, and I thought I would share. Maybe it will help someone else, or maybe I'm crazy. In my schema xml file I have this: Note, that I had to stick the autoIncrement="true" line in there, or else hypersonic did'nt reconize that this column was the primary key, and would give errors about passing NULL for a non null column. Now, with the autoIncrement="true" and primaryKey="true" then torque was generating the init tables sql code like this (for hypersonic): CREATE TABLE portal_setting ( portal_setting_id integer IDENTITY, default_skin_id integer PRIMARY KEY( portal_setting_id ), ); Hypersonic however didnt like that. When I would create the database in hypersonic, it would say that I was creating a second primary key. So I changed the template for outputing primary keys for hypersonic to this: #if ($table.hasPrimaryKey()) ## PRIMARY KEY($table.printPrimaryKey()), #end It all works fine. In fact, if I peek in the hypersonic database script file it shows that it is a primary key: CREATE TABLE PORTAL_SETTING(PORTAL_SETTING_ID INTEGER NOT NULL IDENTITY PRIMARY KEY,DEFAULT_SKIN_ID INTEGER) Maybe the templates for hypersonic should be updated? Hope this helps someone. Ryan Christianson --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org