mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
#2390 - Tidy generated SQL removing excess whitespace after id = ? predicate
This commit is contained in:
1 parent
0a4c26965c
commit
3244314424
5 files changed
+7
-9
No files matched your search
@@ -66,7 +66,7 @@ public class TestQueryForUpdate extends BaseTestCase {
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(2);
|
||||
assertThat(sql.get(0)).contains("from o_order");
|
||||
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
|
||||
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
|
||||
|
||||
transaction.commit();
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class TestQueryForUpdate extends BaseTestCase {
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(2);
|
||||
assertThat(sql.get(0)).contains("from o_order");
|
||||
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
|
||||
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
|
||||
|
||||
transaction.commit();
|
||||
}
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class TestMTOInheritNoDiscriminator extends BaseTestCase {
|
||||
|
||||
assertThat(sql).hasSize(1);
|
||||
if (isH2() || isPostgres()) {
|
||||
assertSql(sql.get(0)).contains("select t0.id, t0.name, t0.version, t2.type, t0.truck_plate_no, t0.basic_id, t1.id, t1.some_uid, t1.foo, t1.owner_id from ttruck_holder t0 join tcar t2 on t2.plate_no = t0.truck_plate_no left join ttruck_holder_item t1 on t1.owner_id = t0.id where t0.id = ? order by t0.id");
|
||||
assertSql(sql.get(0)).contains("select t0.id, t0.name, t0.version, t2.type, t0.truck_plate_no, t0.basic_id, t1.id, t1.some_uid, t1.foo, t1.owner_id from ttruck_holder t0 join tcar t2 on t2.plate_no = t0.truck_plate_no left join ttruck_holder_item t1 on t1.owner_id = t0.id where t0.id = ? order by t0.id");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,13 +44,11 @@ public class TestEmbeddedManyToOne extends BaseTestCase {
|
||||
assertThat(found.getAddress().getCountry().getCode()).isEqualTo("NZ");
|
||||
assertThat(found.getAddress().getCountry().getName()).startsWith("New");
|
||||
|
||||
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(2);
|
||||
|
||||
if (isH2()) {
|
||||
assertSql(sql.get(0)).contains("select t0.id, t0.name, t0.version, t0.ma_street, t0.ma_suburb, t0.ma_city, t0.ma_country_code from eper_addr t0 where t0.id = ? ");
|
||||
assertSql(sql.get(1)).contains("select t0.code, t0.name from o_country t0 where t0.code = ? ; --bind(NZ,");
|
||||
assertSql(sql.get(0)).contains("select t0.id, t0.name, t0.version, t0.ma_street, t0.ma_suburb, t0.ma_city, t0.ma_country_code from eper_addr t0 where t0.id = ?");
|
||||
assertSql(sql.get(1)).contains("select t0.code, t0.name from o_country t0 where t0.code = ?; --bind(NZ,");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user