Add SAP HANA support (#1511)

This commit is contained in:
Jonathan Bregler
2018-10-24 21:38:17 +13:00
committed by Rob Bygrave
parent b1410cc660
commit 158ee9a081
79 changed files with 2596 additions and 215 deletions
@@ -4,7 +4,9 @@ import io.ebean.BaseTestCase;
import io.ebean.Ebean;
import io.ebean.EbeanServer;
import io.ebean.Transaction;
import io.ebean.annotation.IgnorePlatform;
import io.ebean.annotation.PersistBatch;
import io.ebean.annotation.Platform;
import io.ebean.annotation.Transactional;
import io.ebean.meta.BasicMetricVisitor;
import io.ebean.meta.MetaTimedMetric;
@@ -119,6 +121,7 @@ public class TestBatchInsertFlush extends BaseTestCase {
@Test
@Transactional(batch = PersistBatch.ALL)
@IgnorePlatform(Platform.HANA)
public void transactional_flushOnGetId() {
EbeanServer server = Ebean.getDefaultServer();
@@ -141,6 +144,7 @@ public class TestBatchInsertFlush extends BaseTestCase {
}
@Test
@IgnorePlatform(Platform.HANA)
public void testFlushOnGetId() {
EbeanServer server = Ebean.getDefaultServer();
@@ -3,7 +3,9 @@ package org.tests.batchinsert;
import io.ebean.BaseTestCase;
import io.ebean.Ebean;
import io.ebean.Transaction;
import io.ebean.annotation.IgnorePlatform;
import io.ebean.annotation.PersistBatch;
import io.ebean.annotation.Platform;
import io.ebean.annotation.Transactional;
import org.junit.Test;
import org.tests.model.basic.UTDetail;
@@ -46,6 +48,7 @@ public class TestBatchInsertSimple extends BaseTestCase {
}
@Test
@IgnorePlatform(Platform.HANA)
public void testTransactional() {
saveWithFullBatchMode();
@@ -131,7 +134,7 @@ public class TestBatchInsertSimple extends BaseTestCase {
Transaction transaction = Ebean.beginTransaction();
try {
transaction.setBatch(PersistBatch.NONE);
transaction.setBatchOnCascade(PersistBatch.ALL);
transaction.setBatchOnCascade(spiEbeanServer().getDatabasePlatform().getPersistBatchOnCascade());
transaction.setBatchSize(20);
// escalate based on batchOnCascade value
@@ -3,7 +3,9 @@ package org.tests.batchinsert;
import io.ebean.BaseTestCase;
import io.ebean.EbeanServer;
import io.ebean.Transaction;
import io.ebean.annotation.IgnorePlatform;
import io.ebean.annotation.PersistBatch;
import io.ebean.annotation.Platform;
import io.ebeaninternal.api.SpiTransaction;
import io.ebeaninternal.server.persist.BatchControl;
import org.tests.model.basic.EBasicWithUniqueCon;
@@ -20,6 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class TestBatchOnCascadeExceptionHandling extends BaseTestCase {
@IgnorePlatform(Platform.HANA)
@Test
public void testBatchScenarioWithSavepoint() throws SQLException {
server().save(createEntityWithName("conflict", "before"));
@@ -84,7 +87,7 @@ public class TestBatchOnCascadeExceptionHandling extends BaseTestCase {
Transaction txn = server.beginTransaction();
try {
assertThat(txn.getBatch()).isSameAs(PersistBatch.NONE);
assertThat(txn.getBatchOnCascade()).isSameAs(PersistBatch.ALL);
assertThat(txn.getBatchOnCascade()).isSameAs(spiEbeanServer().getDatabasePlatform().getPersistBatchOnCascade());
failingOperation.run();
Assertions.fail("PersistenceException expected");
@@ -3,6 +3,8 @@ package org.tests.batchinsert;
import io.ebean.BaseTestCase;
import io.ebean.Ebean;
import io.ebean.EbeanServer;
import io.ebean.annotation.IgnorePlatform;
import io.ebean.annotation.Platform;
import io.ebean.annotation.Transactional;
import org.tests.model.basic.Customer;
import org.junit.Test;
@@ -18,6 +20,7 @@ public class TestBatchSaveWithGetBeanId extends BaseTestCase {
*/
@Transactional(batchSize = 10)
@Test
@IgnorePlatform(Platform.HANA) // HANA doesn't support insert batching
public void test() {
EbeanServer server = Ebean.getDefaultServer();