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:
parent
22548f1127
commit
2b59aadc94
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue