For the record, I've found the following workaround work for HSQLDB 2.2.x. Not a lot of testing yet, but seems OK for now.
Overriding the HSQLDialect of hibernate 4.2.x this way works for us: This puts If exists *before* the tablename, and adds CASCADE *after* the tablename.
{code:java} public class MyCustomHsqlDialect extends HSQLDialect { ... @Override public boolean dropConstraints() { return false; }
@Override public boolean supportsIfExistsBeforeTableName() { return true; }
@Override public boolean supportsIfExistsAfterTableName() { return false; }
@Override public String getCascadeConstraintsString() { return " CASCADE "; } } {code}
Don't hesitate to let me know if you feel there's some caveat with this. Btw, I think I'm gonna propose this as a PR for the HsqlDialect. That should help more users and help trigger potential caveats I would have not seen yet.
HTH
|