Return-Path: Delivered-To: apmail-db-ddlutils-user-archive@www.apache.org Received: (qmail 75835 invoked from network); 26 Nov 2008 16:31:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Nov 2008 16:31:04 -0000 Received: (qmail 66761 invoked by uid 500); 26 Nov 2008 16:31:15 -0000 Delivered-To: apmail-db-ddlutils-user-archive@db.apache.org Received: (qmail 66638 invoked by uid 500); 26 Nov 2008 16:31:14 -0000 Mailing-List: contact ddlutils-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-user@db.apache.org Delivered-To: mailing list ddlutils-user@db.apache.org Received: (qmail 66627 invoked by uid 99); 26 Nov 2008 16:31:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Nov 2008 08:31:14 -0800 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_HOTMAIL_RCVD2,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Nov 2008 16:29:47 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1L5NHd-0007FI-1F for ddlutils-user@db.apache.org; Wed, 26 Nov 2008 08:30:33 -0800 Message-ID: <20704354.post@talk.nabble.com> Date: Wed, 26 Nov 2008 08:30:33 -0800 (PST) From: Heng Chu To: ddlutils-user@db.apache.org Subject: excludetables problem and have a fix MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: hengchu@hotmail.com X-Virus-Checked: Checked by ClamAV on apache.org First of all, thanks for this wonderful utility. Very useful w/ a lot of good features. I recently found a problem in ddlutils (latest code in SVN) and have a fix. I am not sure how I can contribute the fix back to the DdlUtils project team. Here is the problem: I use excludetables in the DdlUtils Ant task org.apache.ddlutils.task.DatabaseToDdlTask. Some of the tables listed have foreigh keys to other tables in the DB. I got an error on writeSchemaToFile complaining about this which should be ok. Here is the fix: In org.apache.ddlutils.task.DatabaseToDdlTask, the readModel() method calls the ModelHelper.checkForForeignKeysToAndFromTables() in both the exclude and include cases. That method, as currently implemented, throws an exception if (1) a table in the (exclude or include) list has a foreign key to a table not on the list, OR, (2) a table not on the list has a foreign key into a table in the (exclude or include) list. This is too strict a check and could stop some legit cases -- my problem is actually due to chec (1) which is ok in exclude case. This method should be split into two. For the include case, just check (1) and for excluse case, just check (2). I made the straightfoward change in my local copy and things went ok. I just want to report this and hope it's fixed in the near future. Thanks! Heng -- View this message in context: http://www.nabble.com/excludetables-problem-and-have-a-fix-tp20704354p20704354.html Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.