mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Sqlserver support (#1053)
* made some tests sqlserver ready (No effective code change in src/main) * FIX enhance packages and let all testcases inherit from BaseTestCase, so that they can be launched directly from eclipse * ADD sqldriver in pom and datasource * FIX: DDL-generation for sqlserver - not yet all sqlserver tests passing mvn verify -Ddatasource.default=mssql => Tests run: 1980, Failures: 22, Errors: 44, Skipped: 16 * BaseDdlHandlerTest checks against correct sqlserver-ddl now
This commit is contained in:
committed by
Rob Bygrave
parent
e49c4bfe5a
commit
2001539755
@@ -31,7 +31,14 @@ public class SqlQueryTests extends BaseTestCase {
|
||||
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
|
||||
assertThat(sql.get(0)).contains("Select * from o_order limit 10 offset 3; --bind()");
|
||||
if (isSqlServer()) {
|
||||
// FIXME: we should order by primary key ALWAYS (not by first column) when no
|
||||
// explicit order is specified. In postgres this leads to strange scrolling
|
||||
// artifacts.
|
||||
assertThat(sql.get(0)).contains("order by 1 offset 3 rows fetch next 10 rows only");
|
||||
} else {
|
||||
assertThat(sql.get(0)).contains("Select * from o_order limit 10 offset 3; --bind()");
|
||||
}
|
||||
assertThat(list).isNotEmpty();
|
||||
}
|
||||
|
||||
@@ -65,7 +72,11 @@ public class SqlQueryTests extends BaseTestCase {
|
||||
sqlQuery.findList();
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
|
||||
assertThat(sql.get(0)).contains("Select * from o_order order by id limit 10");
|
||||
if (isSqlServer()) {
|
||||
assertThat(sql.get(0)).contains("Select * from o_order order by id offset 0 rows fetch next 10 rows only;");
|
||||
} else {
|
||||
assertThat(sql.get(0)).contains("Select * from o_order order by id limit 10");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -81,7 +92,11 @@ public class SqlQueryTests extends BaseTestCase {
|
||||
sqlQuery.findList();
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
|
||||
assertThat(sql.get(0)).contains("select * from o_order where o_order.id > ? order by id limit 10;");
|
||||
if (isSqlServer()) {
|
||||
assertThat(sql.get(0)).contains("select * from o_order where o_order.id > ? order by id offset 0 rows fetch next 10 rows only;");
|
||||
} else {
|
||||
assertThat(sql.get(0)).contains("select * from o_order where o_order.id > ? order by id limit 10;");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -96,7 +111,11 @@ public class SqlQueryTests extends BaseTestCase {
|
||||
sqlQuery.findEach(bean -> bean.get("id"));
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
|
||||
assertThat(sql.get(0)).contains("limit 10");
|
||||
if (isSqlServer()) {
|
||||
assertThat(sql.get(0)).contains("offset 0 rows fetch next 10 rows only");
|
||||
} else {
|
||||
assertThat(sql.get(0)).contains("limit 10");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user