mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-23 21:15:52 +00:00
Update tests for running MySql
This commit is contained in:
@@ -11,8 +11,8 @@ import javax.persistence.OneToOne;
|
||||
@Entity
|
||||
public class HsdSetting extends BaseDomain {
|
||||
|
||||
String key;
|
||||
String val;
|
||||
String code;
|
||||
String content;
|
||||
|
||||
@SoftDelete
|
||||
boolean deleted;
|
||||
@@ -21,27 +21,27 @@ public class HsdSetting extends BaseDomain {
|
||||
private HsdUser user;
|
||||
|
||||
|
||||
public HsdSetting(String key) {
|
||||
this.key = key;
|
||||
public HsdSetting(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public HsdSetting() {
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getVal() {
|
||||
return val;
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setVal(String val) {
|
||||
this.val = val;
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public boolean isDeleted() {
|
||||
|
||||
@@ -16,11 +16,24 @@ public class TestQuotedIdentifierQuery extends BaseTestCase {
|
||||
|
||||
Ebean.save(bean);
|
||||
|
||||
Ebean.find(BWithQIdent.class)
|
||||
.where()
|
||||
.eq("name", "foo")
|
||||
.raw("t0.\"Name\" = ?", "foo")
|
||||
.raw("t0.\"CODE\" = ?", "bar")
|
||||
.findList();
|
||||
if (isMySql()) {
|
||||
|
||||
Ebean.find(BWithQIdent.class)
|
||||
.where()
|
||||
.eq("name", "foo")
|
||||
.raw("t0.`Name` = ?", "foo")
|
||||
.raw("t0.`CODE` = ?", "bar")
|
||||
.findList();
|
||||
|
||||
} else if (isH2() || isPostgres()) {
|
||||
|
||||
Ebean.find(BWithQIdent.class)
|
||||
.where()
|
||||
.eq("name", "foo")
|
||||
.raw("t0.\"Name\" = ?", "foo")
|
||||
.raw("t0.\"CODE\" = ?", "bar")
|
||||
.findList();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ public class TestSoftDeleteBasic extends BaseTestCase {
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
|
||||
assertThat(sql).hasSize(2);
|
||||
assertThat(sql.get(0)).contains("from ebasic_sdchild t0 where t0.owner_id = ? and t0.deleted = false");
|
||||
assertThat(sql.get(1)).contains("from ebasic_sdchild t0 where t0.owner_id = ? and t0.deleted = false");
|
||||
assertThat(sql.get(0)).contains("from ebasic_sdchild t0 where t0.owner_id = ? and t0.deleted = ");
|
||||
assertThat(sql.get(1)).contains("from ebasic_sdchild t0 where t0.owner_id = ? and t0.deleted = ");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user