mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-11 01:40:07 +00:00
Fix some testcases fof MySql/SqlServer (#1591)
* FIX testcases for MariaDB+utf8mb4 (Failure was: "Specified key was too long; max key length is 767 bytes") * Excluded tests that won't work on SqlServers generated ids
This commit is contained in:
1 parent
7aef4ff1bd
commit
7ed4435ccc
12 files changed
+33
-5
No files matched your search
@@ -17,7 +17,7 @@ import static org.junit.Assert.assertEquals;
|
||||
public class TestInsertBatchThenUpdate extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
@IgnorePlatform(Platform.HANA)
|
||||
@IgnorePlatform({Platform.SQLSERVER, Platform.HANA}) // has generated IDs
|
||||
public void test() {
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
@@ -50,7 +50,7 @@ public class TestInsertBatchThenUpdate extends BaseTestCase {
|
||||
|
||||
// insert statements for EdExtendedParent
|
||||
List<String> loggedSql = LoggedSqlCollector.stop();
|
||||
assertEquals(3, loggedSql.size());
|
||||
assertThat(loggedSql).hasSize(3);
|
||||
assertThat(loggedSql.get(0)).contains("insert into td_parent");
|
||||
assertThat(loggedSql.get(1)).contains("insert into td_child ");
|
||||
assertThat(loggedSql.get(2)).contains("update td_parent set parent_name=? where parent_id=?");
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.tests.model.composite;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Embeddable
|
||||
@@ -14,6 +16,7 @@ public class CkeClientKey {
|
||||
|
||||
@Basic(optional = false)
|
||||
@Column(name = "cod_client")
|
||||
@Size(max=100)
|
||||
private String codClient;
|
||||
|
||||
public CkeClientKey(int codCompany, String codClient) {
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.tests.model.composite;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Embeddable
|
||||
@@ -10,6 +12,7 @@ public class CkeUserKey {
|
||||
|
||||
@Basic(optional = false)
|
||||
@Column(name = "username")
|
||||
@Size(max=100)
|
||||
private String username;
|
||||
|
||||
@Basic(optional = false)
|
||||
|
||||
@@ -2,11 +2,13 @@ package org.tests.model.onetoone;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Entity
|
||||
public class OtoAone {
|
||||
|
||||
@Id
|
||||
@Size(max = 100)
|
||||
private String id;
|
||||
|
||||
private String description;
|
||||
|
||||
@@ -4,11 +4,13 @@ import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Entity
|
||||
public class OtoAtwo {
|
||||
|
||||
@Id
|
||||
@Size(max = 100)
|
||||
private String id;
|
||||
|
||||
private String description;
|
||||
|
||||
@@ -4,11 +4,13 @@ import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Version;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Entity
|
||||
public class OrpDetail {
|
||||
|
||||
@Id
|
||||
@Size(max=100)
|
||||
String id;
|
||||
|
||||
String detail;
|
||||
|
||||
@@ -3,11 +3,13 @@ package org.tests.model.orphanremoval;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Version;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Entity
|
||||
public class OrpDetail2 {
|
||||
|
||||
@Id
|
||||
@Size(max=100)
|
||||
String id;
|
||||
|
||||
String detail;
|
||||
|
||||
@@ -7,6 +7,8 @@ import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Version;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Cache
|
||||
@@ -14,6 +16,7 @@ import java.util.List;
|
||||
public class OrpMaster {
|
||||
|
||||
@Id
|
||||
@Size(max = 100)
|
||||
String id;
|
||||
|
||||
String name;
|
||||
|
||||
@@ -7,6 +7,8 @@ import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Version;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Cache
|
||||
@@ -14,6 +16,7 @@ import java.util.List;
|
||||
public class OrpMaster2 {
|
||||
|
||||
@Id
|
||||
@Size(max=100)
|
||||
String id;
|
||||
|
||||
String name;
|
||||
|
||||
Reference in new issue
Block a user