HHH-11236 - JPA hbm2ddl auto-generation creates ddl with invalid syntax for Unique Key with any MySQLDialect

Change test configuration to use update instead of create-drop
This commit is contained in:
Vlad Mihalcea 2017-01-10 09:08:44 +02:00
parent 22548f1127
commit 2b59aadc94
1 changed files with 11 additions and 0 deletions

View File

@ -15,6 +15,8 @@ import javax.persistence.Id;
import javax.persistence.PersistenceException;
import javax.persistence.Table;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.testing.TestForIssue;
@ -36,6 +38,10 @@ public class UniqueConstraintThrowsConstraintViolationExceptionTest extends Base
return new Class[] { Customer.class };
}
protected void configure(Configuration configuration) {
configuration.setProperty( Environment.HBM2DDL_AUTO, "update" );
}
@Test
public void testUniqueConstraintWithEmptyColumnName() {
doInHibernate( this::sessionFactory, session -> {
@ -59,6 +65,11 @@ public class UniqueConstraintThrowsConstraintViolationExceptionTest extends Base
}
}
@Override
protected boolean isCleanupTestDataRequired() {
return true;
}
@Entity
@Table(name = "CUSTOMER")
public static class Customer {