mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Add SAP HANA support (#1511)
This commit is contained in:
committed by
Rob Bygrave
parent
b1410cc660
commit
158ee9a081
+38
-10
@@ -23,9 +23,17 @@ public class TestElementCollectionBasicSet extends BaseTestCase {
|
||||
Ebean.save(person);
|
||||
|
||||
List<String> sql = LoggedSqlCollector.current();
|
||||
assertThat(sql).hasSize(2);
|
||||
assertThat(sql.get(0)).contains("insert into ecs_person");
|
||||
assertThat(sql.get(1)).contains("insert into ecs_person_phone");
|
||||
if (isPersistBatchOnCascade()) {
|
||||
assertThat(sql).hasSize(2);
|
||||
assertThat(sql.get(0)).contains("insert into ecs_person");
|
||||
assertThat(sql.get(1)).contains("insert into ecs_person_phone");
|
||||
}
|
||||
else {
|
||||
assertThat(sql).hasSize(3);
|
||||
assertThat(sql.get(0)).contains("insert into ecs_person");
|
||||
assertThat(sql.get(1)).contains("insert into ecs_person_phone");
|
||||
assertThat(sql.get(2)).contains("insert into ecs_person_phone");
|
||||
}
|
||||
|
||||
EcsPerson person1 = new EcsPerson("Fiona09");
|
||||
person1.getPhoneNumbers().add("09 1234");
|
||||
@@ -94,10 +102,20 @@ public class TestElementCollectionBasicSet extends BaseTestCase {
|
||||
Ebean.save(bean);
|
||||
|
||||
List<String> sql = LoggedSqlCollector.current();
|
||||
assertThat(sql).hasSize(3);
|
||||
assertThat(sql.get(0)).contains("update ecs_person set name=?, version=? where id=? and version=?");
|
||||
assertThat(sql.get(1)).contains("delete from ecs_person_phone where ecs_person_id=?");
|
||||
assertThat(sql.get(2)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
if (isPersistBatchOnCascade()) {
|
||||
assertThat(sql).hasSize(3);
|
||||
assertThat(sql.get(0)).contains("update ecs_person set name=?, version=? where id=? and version=?");
|
||||
assertThat(sql.get(1)).contains("delete from ecs_person_phone where ecs_person_id=?");
|
||||
assertThat(sql.get(2)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
}
|
||||
else {
|
||||
assertThat(sql).hasSize(5);
|
||||
assertThat(sql.get(0)).contains("update ecs_person set name=?, version=? where id=? and version=?");
|
||||
assertThat(sql.get(1)).contains("delete from ecs_person_phone where ecs_person_id=?");
|
||||
assertThat(sql.get(2)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
assertThat(sql.get(3)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
assertThat(sql.get(4)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
}
|
||||
|
||||
updateNothing(bean);
|
||||
}
|
||||
@@ -118,9 +136,19 @@ public class TestElementCollectionBasicSet extends BaseTestCase {
|
||||
Ebean.save(bean);
|
||||
|
||||
List<String> sql = LoggedSqlCollector.current();
|
||||
assertThat(sql).hasSize(2);
|
||||
assertThat(sql.get(0)).contains("delete from ecs_person_phone where ecs_person_id=?");
|
||||
assertThat(sql.get(1)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
if (isPersistBatchOnCascade()) {
|
||||
assertThat(sql).hasSize(2);
|
||||
assertThat(sql.get(0)).contains("delete from ecs_person_phone where ecs_person_id=?");
|
||||
assertThat(sql.get(1)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
}
|
||||
else {
|
||||
assertThat(sql).hasSize(5);
|
||||
assertThat(sql.get(0)).contains("delete from ecs_person_phone where ecs_person_id=?");
|
||||
assertThat(sql.get(1)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
assertThat(sql.get(2)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
assertThat(sql.get(3)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
assertThat(sql.get(4)).contains("insert into ecs_person_phone (ecs_person_id,phone) values (?,?)");
|
||||
}
|
||||
|
||||
delete(bean);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user