Hibernate/H2 foreign key throwing org.h2.jdbc.JdbcSQLException
问题 I'm trying to use an H2 db for my unit testing. My actual database is MYSql, so i'm using the MYSQL dialect with H2. The problem appears to happen once the hbm files are read/loaded. The foreign keys/associations go out of whack as H2 or Hibernate try to alter the tables., or so it seems. DB scripts: DROP SCHEMA IF EXISTS `amr` ; CREATE SCHEMA IF NOT EXISTS `amr`; -- ----------------------------------------------------- -- Table `amr`.`classA` -- ----------------------------------------------