Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 88686 invoked from network); 17 Apr 2005 10:45:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Apr 2005 10:45:45 -0000 Received: (qmail 16090 invoked by uid 500); 17 Apr 2005 10:45:45 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 15924 invoked by uid 500); 17 Apr 2005 10:45:44 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 15911 invoked by uid 500); 17 Apr 2005 10:45:44 -0000 Received: (qmail 15907 invoked by uid 99); 17 Apr 2005 10:45:44 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 17 Apr 2005 03:45:44 -0700 Received: (qmail 88677 invoked by uid 1977); 17 Apr 2005 10:45:43 -0000 Date: 17 Apr 2005 10:45:43 -0000 Message-ID: <20050417104543.88676.qmail@minotaur.apache.org> From: tfischer@apache.org To: db-torque-cvs@apache.org Subject: cvs commit: db-torque/src/generator/src/java/org/apache/torque/engine/database/model Column.java X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N tfischer 2005/04/17 03:45:43 Modified: src/generator/src/dtd database.dtd xdocs changes.xml src/generator/src/java/org/apache/torque/engine/database/model Column.java Log: Set autoIncrement=true for primary keys with idMethod=native and the platform's defaultIdMethod="identity" (i.e. all databases except oracle, postgresql and sapdb). This behaviour can be overridden by explicitly setting autoincrement=false in the respective column Revision Changes Path 1.7 +2 -2 db-torque/src/generator/src/dtd/database.dtd Index: database.dtd =================================================================== RCS file: /home/cvs/db-torque/src/generator/src/dtd/database.dtd,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- database.dtd 9 Mar 2005 14:17:32 -0000 1.6 +++ database.dtd 17 Apr 2005 10:45:43 -0000 1.7 @@ -118,7 +118,7 @@ size CDATA #IMPLIED scale CDATA #IMPLIED default CDATA #IMPLIED - autoIncrement (true|false) "false" + autoIncrement (true|false) #IMPLIED inheritance (single|false) "false" inputValidator CDATA #IMPLIED javaNamingMethod (nochange|underscore|javaname) #IMPLIED 1.153 +8 -0 db-torque/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/db-torque/xdocs/changes.xml,v retrieving revision 1.152 retrieving revision 1.153 diff -u -r1.152 -r1.153 --- changes.xml 17 Apr 2005 09:58:59 -0000 1.152 +++ changes.xml 17 Apr 2005 10:45:43 -0000 1.153 @@ -28,6 +28,14 @@ + + Unify the behaviour of primary key columns. Until now, + primary key columns were not filled automatically for + idMethod=native and for platforms with + default idMethod=identity (i.e. all databases exept oracle, + postgresql and sapdb). Now, the default is that primary key + columns are always filled automatically by default. + Use the cascade option for dropping tables in PostgreSQL. This allows to drop tables which have foreign keys. 1.28 +12 -3 db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Column.java Index: Column.java =================================================================== RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Column.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- Column.java 31 Jan 2005 19:43:56 -0000 1.27 +++ Column.java 17 Apr 2005 10:45:43 -0000 1.28 @@ -170,8 +170,17 @@ //AutoIncrement/Sequences String autoIncrement = attrib.getValue("autoIncrement"); - isAutoIncrement = ("true".equals(autoIncrement)); - + // autoincrement is false per default, + // except if the column is a primary key + // and the idMethod is native + // and the platform's default id Method is identity + // and autoIncrement is not excplicitly set to false + isAutoIncrement = ("true".equals(autoIncrement) + || (isPrimaryKey() + && IDMethod.NATIVE.equals(getTable().getIdMethod()) + && Platform.IDENTITY.equals( + getPlatform().getNativeIdMethod()) + && (!"false".equals(autoIncrement)))); //Default column value. domain.replaceDefaultValue(attrib.getValue("default")); --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org