-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9eb0875
commit 709b21a
Showing
5 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/groovy/com/jcatalog/hibernate/dialect/ImprovedH2Dialect.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.jcatalog.hibernate.dialect | ||
|
||
import org.hibernate.dialect.H2Dialect | ||
/** | ||
* Workaround. | ||
* | ||
* @see https://hibernate.onjira.com/browse/HHH-7002 | ||
* | ||
*/ | ||
public class ImprovedH2Dialect extends H2Dialect { | ||
@Override | ||
public String getDropSequenceString(String sequenceName) { | ||
// Adding the "if exists" clause to avoid warnings | ||
return "drop sequence if exists " + sequenceName; | ||
} | ||
|
||
@Override | ||
public boolean dropConstraints() { | ||
// We don't need to drop constraints before dropping tables, that just | ||
// leads to error messages about missing tables when we don't have a | ||
// schema in the database | ||
return false; | ||
} | ||
} |