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