I have seen alot of people posted questions about schemaUpdate for mysql not working correctly. I myself have posted the same question to no avail. After digging aournd in hte source a little i came upon the problem. In net.sf.hibernate.tool.hbm2dll.DatabaseMetaData it queries the database metadata like so
Code:
public TableMetadata getTableMetadata(String name) throws HibernateException {
TableMetadata table = null;
if (name!=null) {
table = (TableMetadata) tables.get( name.toUpperCase() );
if (table==null) {
String[] types = {"TABLE"};
ResultSet rs = null;
try {
try {
rs = meta.getTables(null, "%", name.toUpperCase(), types);
while ( rs.next() ) {
if ( name.equalsIgnoreCase( rs.getString("TABLE_NAME") ) ) {
table = new TableMetadata(rs, meta);
tables.put( name.toUpperCase(), table );
break;
}
}
}
finally {
if (rs!=null) rs.close();
}
}
catch(SQLException e) {
throw new HibernateException(e);
}
}
}
return table;
}
the name.toUpperCase() is the problem, or at least it was for me. I removed it and recompiled hibernate and things worked for me from then on.
Here is my configuration:
MySQL 4.0.16 Max with default table type InnoDB
MySQL connectorJ 3.0.9
Hibernate 2.0.3
I will file this as a bug, in the meantime, you can do the same and try it out.