Title: Message
I have found a problem in the mySQL alter table script generator when adding more than one column to a table.
 
The resultant, faulty DDL is :
 
alter table foo add firstNameRenamed VARCHAR(255), lastNameRenamed VARCHAR(255)
 
Where as the correct DDL is :
 
alter table foo add firstNameRenamed VARCHAR(255), add lastNameRenamed VARCHAR(255)
the difference being the add is repeated for each column.
 
I have investigated the source code for the SchemaUpdater for both versions 1.2 and 2 of hibernate from the CVS repository.
 
In both versions
    the Dialect.getAddColumnString() method has been depreciated
    the Table.sqlAlterString(Dialect,Mapping ,JdbcTableInfo ) method appends the 'add' keyword only once.  This needs to be configurable by Dialect.
 
Who is in charge of this class ?
 
Am I able to modify it by adding to the Dialect a boolean property getAddColumnStringRepeated that defaults to false, and is overridden by the mySQL dialect to set it to true, and to update the Table.sqlAlterString method to check for it ?
 
Thanks.
 

Cameron Braid
Director
Datacodex Pty Ltd
[EMAIL PROTECTED]
http://www.datacodex.com
 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to