db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heng Chu <heng...@hotmail.com>
Subject excludetables problem and have a fix
Date Wed, 26 Nov 2008 16:30:33 GMT

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!

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.

View raw message