ronaldkwandy

Untitled

Nov 6th, 2019
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. package id.co.sofcograha.gajiidapi.testutils;
  2.  
  3. import org.hibernate.dialect.H2Dialect;
  4.  
  5. /**
  6.  * Workaround.
  7.  *
  8.  * @see https://hibernate.onjira.com/browse/HHH-7002
  9.  *
  10.  */
  11. public class ImprovedH2Dialect extends H2Dialect {
  12.  
  13.     @Override
  14.     public String getDropSequenceString(String sequenceName) {
  15.         // Adding the "if exists" clause to avoid warnings
  16.         return "drop sequence if exists " + sequenceName;
  17.     }
  18.  
  19.     @Override
  20.     public boolean dropConstraints() {
  21.         // We don't need to drop constraints before dropping tables, that just
  22.         // leads to error messages about missing tables when we don't have a
  23.         // schema in the database
  24.         return false;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment