mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#374 - MsSqlServer - adjust tests (due to jdbc batch support etc) add in support for unique index handling
This commit is contained in:
@@ -27,6 +27,8 @@ public class TestBatchInsertSimple extends BaseTestCase {
|
||||
transaction.setBatch(PersistBatch.NONE);
|
||||
transaction.setBatchOnCascade(PersistBatch.INSERT);
|
||||
transaction.setBatchSize(30);
|
||||
// setBatchGetGeneratedKeys MUST be turned off for MS SQL Server because :(
|
||||
transaction.setBatchGetGeneratedKeys(false);
|
||||
|
||||
for (int i = 0; i < numOfMasters; i++) {
|
||||
UTMaster master = createMasterAndDetails(i, 20);
|
||||
@@ -43,6 +45,8 @@ public class TestBatchInsertSimple extends BaseTestCase {
|
||||
@Test
|
||||
public void testTransactional() {
|
||||
|
||||
if (isMsSqlServer()) return;
|
||||
|
||||
saveWithFullBatchMode();
|
||||
}
|
||||
|
||||
@@ -69,6 +73,8 @@ public class TestBatchInsertSimple extends BaseTestCase {
|
||||
transaction.setBatch(PersistBatch.NONE);
|
||||
transaction.setBatchOnCascade(PersistBatch.INSERT);
|
||||
transaction.setBatchSize(30);
|
||||
// setBatchGetGeneratedKeys MUST be turned off for MS SQL Server because :(
|
||||
transaction.setBatchGetGeneratedKeys(false);
|
||||
|
||||
for (int i = 0; i < numOfMasters; i++) {
|
||||
UTMaster master = createMaster(i);
|
||||
@@ -85,6 +91,9 @@ public class TestBatchInsertSimple extends BaseTestCase {
|
||||
@Test
|
||||
public void testJdbcBatchOnCollection() {
|
||||
|
||||
// MS SQL Server doesn't like batch inserts when we need getGeneratedKeys
|
||||
if (isMsSqlServer()) return;
|
||||
|
||||
int numOfMasters = 3;
|
||||
|
||||
List<UTMaster> masters = new ArrayList<UTMaster>();
|
||||
|
||||
+2
@@ -18,6 +18,8 @@ public class TestBatchInsertWithInitialisedCollection extends BaseTestCase {
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
if (isMsSqlServer()) return;
|
||||
|
||||
List<OCachedBean> list = new ArrayList();
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
||||
Reference in New Issue
Block a user