mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
#2347 - Rename Database.getPlatform() to platform() with deprecation
This commit is contained in:
1 parent
7fba9adc43
commit
fe67abce83
35 files changed
+76
-53
No files matched your search
@@ -1254,7 +1254,7 @@ public final class DB {
|
|||||||
* queries.
|
* queries.
|
||||||
*/
|
*/
|
||||||
public static BackgroundExecutor getBackgroundExecutor() {
|
public static BackgroundExecutor getBackgroundExecutor() {
|
||||||
return getDefault().getBackgroundExecutor();
|
return getDefault().backgroundExecutor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -214,12 +214,28 @@ public interface Database {
|
|||||||
*
|
*
|
||||||
* @return platform for this database instance
|
* @return platform for this database instance
|
||||||
*/
|
*/
|
||||||
Platform getPlatform();
|
Platform platform();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated migrate to platform().
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
default Platform getPlatform() {
|
||||||
|
return platform();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the extended API intended for use by plugins.
|
* Return the extended API intended for use by plugins.
|
||||||
*/
|
*/
|
||||||
SpiServer getPluginApi();
|
SpiServer pluginApi();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated migrate to pluginApi().
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
default SpiServer getPluginApi() {
|
||||||
|
return pluginApi();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the BeanState for a given entity bean.
|
* Return the BeanState for a given entity bean.
|
||||||
@@ -1485,7 +1501,15 @@ public interface Database {
|
|||||||
* Return the BackgroundExecutor service for asynchronous processing of
|
* Return the BackgroundExecutor service for asynchronous processing of
|
||||||
* queries.
|
* queries.
|
||||||
*/
|
*/
|
||||||
BackgroundExecutor getBackgroundExecutor();
|
BackgroundExecutor backgroundExecutor();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated migrate to backgroundExecutor().
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
default BackgroundExecutor getBackgroundExecutor() {
|
||||||
|
return backgroundExecutor();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the JsonContext for reading/writing JSON.
|
* Return the JsonContext for reading/writing JSON.
|
||||||
|
|||||||
@@ -1216,7 +1216,7 @@ public final class Ebean {
|
|||||||
* queries.
|
* queries.
|
||||||
*/
|
*/
|
||||||
public static BackgroundExecutor getBackgroundExecutor() {
|
public static BackgroundExecutor getBackgroundExecutor() {
|
||||||
return getDefault().getBackgroundExecutor();
|
return getDefault().backgroundExecutor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -843,7 +843,7 @@ public final class EntityBeanIntercept implements Serializable {
|
|||||||
}
|
}
|
||||||
// For stand alone reference bean or after deserialisation lazy load
|
// For stand alone reference bean or after deserialisation lazy load
|
||||||
// using the ebeanServer. Synchronise only on the bean.
|
// using the ebeanServer. Synchronise only on the bean.
|
||||||
loadBeanInternal(loadProperty, database.getPluginApi().beanLoader());
|
loadBeanInternal(loadProperty, database.pluginApi().beanLoader());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadBean(EntityBeanIntercept ebi) {
|
public void loadBean(EntityBeanIntercept ebi) {
|
||||||
database.getPluginApi().loadBeanL2(ebi);
|
database.pluginApi().loadBeanL2(ebi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadBean(EntityBeanIntercept ebi) {
|
public void loadBean(EntityBeanIntercept ebi) {
|
||||||
database.getPluginApi().loadBeanRef(ebi);
|
database.pluginApi().loadBeanRef(ebi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadBean(EntityBeanIntercept ebi) {
|
public void loadBean(EntityBeanIntercept ebi) {
|
||||||
database.getPluginApi().loadBean(ebi);
|
database.pluginApi().loadBean(ebi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -77,7 +77,7 @@ public class DefaultAutoTuneService implements AutoTuneService {
|
|||||||
loadTuningFile();
|
loadTuningFile();
|
||||||
if (isRuntimeTuningUpdates()) {
|
if (isRuntimeTuningUpdates()) {
|
||||||
// periodically gather and update query tuning
|
// periodically gather and update query tuning
|
||||||
server.getBackgroundExecutor().scheduleWithFixedDelay(new ProfilingUpdate(), profilingUpdateFrequency, profilingUpdateFrequency, TimeUnit.SECONDS);
|
server.backgroundExecutor().scheduleWithFixedDelay(new ProfilingUpdate(), profilingUpdateFrequency, profilingUpdateFrequency, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -330,17 +330,17 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Platform getPlatform() {
|
public Platform platform() {
|
||||||
return databasePlatform.getPlatform();
|
return databasePlatform.getPlatform();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SpiServer getPluginApi() {
|
public SpiServer pluginApi() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BackgroundExecutor getBackgroundExecutor() {
|
public BackgroundExecutor backgroundExecutor() {
|
||||||
return backgroundExecutor;
|
return backgroundExecutor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class ConditionalTestRunner extends BlockJUnit4ClassRunner {
|
|||||||
|
|
||||||
}
|
}
|
||||||
private boolean platformMath(Platform[] platforms) {
|
private boolean platformMath(Platform[] platforms) {
|
||||||
Platform basePlatform = DB.getDefault().getPlatform().base();
|
Platform basePlatform = DB.getDefault().platform().base();
|
||||||
for (Platform platform : platforms) {
|
for (Platform platform : platforms) {
|
||||||
if (platform.equals(basePlatform)) {
|
if (platform.equals(basePlatform)) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -20,35 +20,35 @@ public class DatabasePlatformTest extends BaseTestCase {
|
|||||||
@Test
|
@Test
|
||||||
@ForPlatform(Platform.H2)
|
@ForPlatform(Platform.H2)
|
||||||
public void h2_platform() {
|
public void h2_platform() {
|
||||||
final Platform platform = DB.getDefault().getPlatform();
|
final Platform platform = DB.getDefault().platform();
|
||||||
assertThat(platform).isSameAs(Platform.H2);
|
assertThat(platform).isSameAs(Platform.H2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ForPlatform(Platform.POSTGRES)
|
@ForPlatform(Platform.POSTGRES)
|
||||||
public void postgres_platform() {
|
public void postgres_platform() {
|
||||||
final Platform platform = DB.getDefault().getPlatform().base();
|
final Platform platform = DB.getDefault().platform().base();
|
||||||
assertThat(platform).isSameAs(Platform.POSTGRES);
|
assertThat(platform).isSameAs(Platform.POSTGRES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ForPlatform(Platform.MYSQL)
|
@ForPlatform(Platform.MYSQL)
|
||||||
public void mysql_platform() {
|
public void mysql_platform() {
|
||||||
final Platform platform = DB.getDefault().getPlatform().base();
|
final Platform platform = DB.getDefault().platform().base();
|
||||||
assertThat(platform).isSameAs(Platform.MYSQL);
|
assertThat(platform).isSameAs(Platform.MYSQL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ForPlatform(Platform.MARIADB)
|
@ForPlatform(Platform.MARIADB)
|
||||||
public void mariadb_platform() {
|
public void mariadb_platform() {
|
||||||
final Platform platform = DB.getDefault().getPlatform().base();
|
final Platform platform = DB.getDefault().platform().base();
|
||||||
assertThat(platform).isSameAs(Platform.MARIADB);
|
assertThat(platform).isSameAs(Platform.MARIADB);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ForPlatform(Platform.SQLSERVER)
|
@ForPlatform(Platform.SQLSERVER)
|
||||||
public void sqlserver_platform() {
|
public void sqlserver_platform() {
|
||||||
final Platform platform = DB.getDefault().getPlatform().base();
|
final Platform platform = DB.getDefault().platform().base();
|
||||||
assertThat(platform).isSameAs(Platform.SQLSERVER);
|
assertThat(platform).isSameAs(Platform.SQLSERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ public class SqlServerStepSequenceTest extends BaseTestCase {
|
|||||||
server().sqlUpdate("drop sequence if exists sqls_testseq_9876").execute();
|
server().sqlUpdate("drop sequence if exists sqls_testseq_9876").execute();
|
||||||
server().sqlUpdate("create sequence sqls_testseq_9876 start with 1 increment by 50").execute();
|
server().sqlUpdate("create sequence sqls_testseq_9876 start with 1 increment by 50").execute();
|
||||||
|
|
||||||
BackgroundExecutor be = server().getBackgroundExecutor();
|
BackgroundExecutor be = server().backgroundExecutor();
|
||||||
DataSource ds = server().dataSource();
|
DataSource ds = server().dataSource();
|
||||||
|
|
||||||
SqlServerStepSequence s = new SqlServerStepSequence(be, ds, "sqls_testseq_9876", 50);
|
SqlServerStepSequence s = new SqlServerStepSequence(be, ds, "sqls_testseq_9876", 50);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class BeanTypeTest {
|
|||||||
private static Database db = DB.getDefault();
|
private static Database db = DB.getDefault();
|
||||||
|
|
||||||
private <T> BeanType<T> beanType(Class<T> cls) {
|
private <T> BeanType<T> beanType(Class<T> cls) {
|
||||||
return db.getPluginApi().getBeanType(cls);
|
return db.pluginApi().getBeanType(cls);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class ExpressionPathTest {
|
|||||||
static EbeanServer server = Ebean.getDefaultServer();
|
static EbeanServer server = Ebean.getDefaultServer();
|
||||||
|
|
||||||
<T> BeanType<T> beanType(Class<T> cls) {
|
<T> BeanType<T> beanType(Class<T> cls) {
|
||||||
return server.getPluginApi().getBeanType(cls);
|
return server.pluginApi().getBeanType(cls);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class PropertyTest {
|
|||||||
static EbeanServer server = Ebean.getDefaultServer();
|
static EbeanServer server = Ebean.getDefaultServer();
|
||||||
|
|
||||||
<T> BeanType<T> beanType(Class<T> cls) {
|
<T> BeanType<T> beanType(Class<T> cls) {
|
||||||
return server.getPluginApi().getBeanType(cls);
|
return server.pluginApi().getBeanType(cls);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class SpiServerTest extends BaseTestCase {
|
|||||||
public void test() {
|
public void test() {
|
||||||
|
|
||||||
EbeanServer defaultServer = Ebean.getDefaultServer();
|
EbeanServer defaultServer = Ebean.getDefaultServer();
|
||||||
SpiServer pluginApi = defaultServer.getPluginApi();
|
SpiServer pluginApi = defaultServer.pluginApi();
|
||||||
|
|
||||||
BeanType<Customer> beanType = pluginApi.getBeanType(Customer.class);
|
BeanType<Customer> beanType = pluginApi.getBeanType(Customer.class);
|
||||||
assertEquals("o_customer", beanType.getBaseTable());
|
assertEquals("o_customer", beanType.getBaseTable());
|
||||||
|
|||||||
@@ -143,12 +143,12 @@ public class TDSpiEbeanServer implements SpiEbeanServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Platform getPlatform() {
|
public Platform platform() {
|
||||||
return Platform.GENERIC;
|
return Platform.GENERIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SpiServer getPluginApi() {
|
public SpiServer pluginApi() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -924,7 +924,7 @@ public class TDSpiEbeanServer implements SpiEbeanServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BackgroundExecutor getBackgroundExecutor() {
|
public BackgroundExecutor backgroundExecutor() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ public class DefaultChangeLogListenerTest extends BaseTestCase {
|
|||||||
DefaultChangeLogListener changeLogListener = new DefaultChangeLogListener();
|
DefaultChangeLogListener changeLogListener = new DefaultChangeLogListener();
|
||||||
|
|
||||||
EbeanServer defaultServer = Ebean.getDefaultServer();
|
EbeanServer defaultServer = Ebean.getDefaultServer();
|
||||||
changeLogListener.configure(defaultServer.getPluginApi());
|
changeLogListener.configure(defaultServer.pluginApi());
|
||||||
|
|
||||||
ChangeSet changeSet = helper.createChangeSet("INT-001", 13);
|
ChangeSet changeSet = helper.createChangeSet("INT-001", 13);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ public class TestShutdownWithBackgroundTasks extends BaseTestCase {
|
|||||||
public void test() {
|
public void test() {
|
||||||
|
|
||||||
Database server = DB.getDefault();
|
Database server = DB.getDefault();
|
||||||
final BackgroundExecutor bg = server.getBackgroundExecutor();
|
final BackgroundExecutor bg = server.backgroundExecutor();
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < 12; i++) {
|
for (int i = 0; i < 12; i++) {
|
||||||
bg.execute(new Job(server, 500, i));
|
bg.execute(new Job(server, 500, i));
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ public class DocStoreDeleteEventTest {
|
|||||||
static EbeanServer server = Ebean.getDefaultServer();
|
static EbeanServer server = Ebean.getDefaultServer();
|
||||||
|
|
||||||
<T> BeanType<T> beanType(Class<T> cls) {
|
<T> BeanType<T> beanType(Class<T> cls) {
|
||||||
return server.getPluginApi().getBeanType(cls);
|
return server.pluginApi().getBeanType(cls);
|
||||||
}
|
}
|
||||||
|
|
||||||
BeanType<Order> orderType() {
|
BeanType<Order> orderType() {
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ public class DocStoreIndexEventTest {
|
|||||||
static EbeanServer server = Ebean.getDefaultServer();
|
static EbeanServer server = Ebean.getDefaultServer();
|
||||||
|
|
||||||
<T> BeanType<T> beanType(Class<T> cls) {
|
<T> BeanType<T> beanType(Class<T> cls) {
|
||||||
return server.getPluginApi().getBeanType(cls);
|
return server.pluginApi().getBeanType(cls);
|
||||||
}
|
}
|
||||||
|
|
||||||
BeanType<Order> orderType() {
|
BeanType<Order> orderType() {
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ public class TestQueryCache extends BaseTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void findCountDifferentQueriesBit() {
|
public void findCountDifferentQueriesBit() {
|
||||||
DB.getDefault().getPluginApi().getServerCacheManager().clearAll();
|
DB.getDefault().pluginApi().getServerCacheManager().clearAll();
|
||||||
differentFindCount(q->q.bitwiseAny("id",1), q->q.bitwiseAny("id",0));
|
differentFindCount(q->q.bitwiseAny("id",1), q->q.bitwiseAny("id",0));
|
||||||
differentFindCount(q->q.bitwiseAll("id",1), q->q.bitwiseAll("id",0));
|
differentFindCount(q->q.bitwiseAll("id",1), q->q.bitwiseAll("id",0));
|
||||||
// differentFindCount(q->q.bitwiseNot("id",1), q->q.bitwiseNot("id",0)); NOT 1 == AND 1 = 0
|
// differentFindCount(q->q.bitwiseNot("id",1), q->q.bitwiseNot("id",0)); NOT 1 == AND 1 = 0
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class TestDPersonEl {
|
|||||||
|
|
||||||
Currency NZD = Currency.getInstance("NZD");
|
Currency NZD = Currency.getInstance("NZD");
|
||||||
assertThat(NZD).isNotNull();
|
assertThat(NZD).isNotNull();
|
||||||
|
|
||||||
DPerson p = new DPerson();
|
DPerson p = new DPerson();
|
||||||
p.setFirstName("first");
|
p.setFirstName("first");
|
||||||
p.setLastName("last");
|
p.setLastName("last");
|
||||||
@@ -31,7 +31,7 @@ public class TestDPersonEl {
|
|||||||
|
|
||||||
Ebean.save(p);
|
Ebean.save(p);
|
||||||
|
|
||||||
SpiServer server = Ebean.getDefaultServer().getPluginApi();
|
SpiServer server = Ebean.getDefaultServer().pluginApi();
|
||||||
|
|
||||||
BeanType<DPerson> descriptor = server.getBeanType(DPerson.class);
|
BeanType<DPerson> descriptor = server.getBeanType(DPerson.class);
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class TestPathExpression {
|
|||||||
final ExpressionPath city;
|
final ExpressionPath city;
|
||||||
|
|
||||||
public TestPathExpression() {
|
public TestPathExpression() {
|
||||||
SpiServer server = Ebean.getDefaultServer().getPluginApi();
|
SpiServer server = Ebean.getDefaultServer().pluginApi();
|
||||||
beanType = server.getBeanType(Customer.class);
|
beanType = server.getBeanType(Customer.class);
|
||||||
billingId = beanType.getExpressionPath("billingAddress.id");
|
billingId = beanType.getExpressionPath("billingAddress.id");
|
||||||
line1 = beanType.getExpressionPath("billingAddress.line1");
|
line1 = beanType.getExpressionPath("billingAddress.line1");
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class TestDbJson_Jackson extends BaseTestCase {
|
|||||||
bean.getValueMap().put(1, "one");
|
bean.getValueMap().put(1, "one");
|
||||||
bean.getValueMap().put(2, "two");
|
bean.getValueMap().put(2, "two");
|
||||||
|
|
||||||
ObjectMapper mapper = (ObjectMapper) Ebean.getDefaultServer().getPluginApi().getServerConfig().getObjectMapper();
|
ObjectMapper mapper = (ObjectMapper) Ebean.getDefaultServer().pluginApi().getServerConfig().getObjectMapper();
|
||||||
|
|
||||||
String json = mapper.writeValueAsString(bean);
|
String json = mapper.writeValueAsString(bean);
|
||||||
EBasicJsonJackson found = mapper.readValue(json, EBasicJsonJackson.class);
|
EBasicJsonJackson found = mapper.readValue(json, EBasicJsonJackson.class);
|
||||||
@@ -83,7 +83,7 @@ public class TestDbJson_Jackson extends BaseTestCase {
|
|||||||
bean.getValueMap().put(1, new StringJacksonType("A"));
|
bean.getValueMap().put(1, new StringJacksonType("A"));
|
||||||
bean.getValueMap().put(2, new LongJacksonType(7l));
|
bean.getValueMap().put(2, new LongJacksonType(7l));
|
||||||
|
|
||||||
ObjectMapper mapper = (ObjectMapper) Ebean.getDefaultServer().getPluginApi().getServerConfig().getObjectMapper();
|
ObjectMapper mapper = (ObjectMapper) Ebean.getDefaultServer().pluginApi().getServerConfig().getObjectMapper();
|
||||||
|
|
||||||
String json = mapper.writeValueAsString(bean);
|
String json = mapper.writeValueAsString(bean);
|
||||||
assertThat(json)
|
assertThat(json)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class TestDbJson_Jackson2 extends BaseTestCase {
|
|||||||
bean.getValueMap().put(1, new StringJacksonType("A"));
|
bean.getValueMap().put(1, new StringJacksonType("A"));
|
||||||
bean.getValueMap().put(2, new LongJacksonType(7l));
|
bean.getValueMap().put(2, new LongJacksonType(7l));
|
||||||
|
|
||||||
ObjectMapper mapper = (ObjectMapper) Ebean.getDefaultServer().getPluginApi().getServerConfig().getObjectMapper();
|
ObjectMapper mapper = (ObjectMapper) Ebean.getDefaultServer().pluginApi().getServerConfig().getObjectMapper();
|
||||||
|
|
||||||
String json = mapper.writeValueAsString(bean);
|
String json = mapper.writeValueAsString(bean);
|
||||||
found = mapper.readValue(json, EBasicJsonJackson2.class);
|
found = mapper.readValue(json, EBasicJsonJackson2.class);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class TestEmbeddedManyToOne extends BaseTestCase {
|
|||||||
|
|
||||||
ResetBasicData.reset();
|
ResetBasicData.reset();
|
||||||
|
|
||||||
BeanType<EAddr> embType = Ebean.getDefaultServer().getPluginApi().getBeanType(EAddr.class);
|
BeanType<EAddr> embType = Ebean.getDefaultServer().pluginApi().getBeanType(EAddr.class);
|
||||||
|
|
||||||
Ebean.getDefaultServer().getServerCacheManager().clearAll();
|
Ebean.getDefaultServer().getServerCacheManager().clearAll();
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ public class TestQueryFindIterate extends BaseTestCase {
|
|||||||
public void findIterateCloseConnection(boolean withLoadBatch) {
|
public void findIterateCloseConnection(boolean withLoadBatch) {
|
||||||
ResetBasicData.reset();
|
ResetBasicData.reset();
|
||||||
|
|
||||||
SpiServer pluginApi = server().getPluginApi();
|
SpiServer pluginApi = server().pluginApi();
|
||||||
DataSourcePool dsPool = (DataSourcePool) pluginApi.getServerConfig().getReadOnlyDataSource();
|
DataSourcePool dsPool = (DataSourcePool) pluginApi.getServerConfig().getReadOnlyDataSource();
|
||||||
if (dsPool == null) {
|
if (dsPool == null) {
|
||||||
dsPool = (DataSourcePool) server().dataSource();
|
dsPool = (DataSourcePool) server().dataSource();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package org.tests.query.cancel;
|
package org.tests.query.cancel;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
|
||||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -76,7 +75,7 @@ public class SqlQueryCancelTest extends BaseTestCase {
|
|||||||
EBasic model = new EBasic("Basic " + i);
|
EBasic model = new EBasic("Basic " + i);
|
||||||
DB.save(model);
|
DB.save(model);
|
||||||
}
|
}
|
||||||
if (Platform.H2.equals(DB.getDefault().getPlatform())) {
|
if (Platform.H2.equals(DB.getDefault().platform())) {
|
||||||
SlowDownEBasic.setSelectWaitMillis(0);
|
SlowDownEBasic.setSelectWaitMillis(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ public class TestNativeILikeExpression extends BaseTestCase {
|
|||||||
|
|
||||||
private boolean isExpectNative() {
|
private boolean isExpectNative() {
|
||||||
|
|
||||||
SpiServer pluginApi = server().getPluginApi();
|
SpiServer pluginApi = server().pluginApi();
|
||||||
boolean expressionNativeIlike = pluginApi.getServerConfig().isExpressionNativeIlike();
|
boolean expressionNativeIlike = pluginApi.getServerConfig().isExpressionNativeIlike();
|
||||||
Platform platform = pluginApi.getPlatform().base();
|
Platform platform = pluginApi.platform().base();
|
||||||
|
|
||||||
return expressionNativeIlike && platform == Platform.POSTGRES;
|
return expressionNativeIlike && platform == Platform.POSTGRES;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ public class TestTextJsonInvokeLazy extends BaseTestCase {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void clearBeanCache() {
|
public void clearBeanCache() {
|
||||||
server().getPluginApi().getBeanType(Customer.class).clearBeanCache();
|
server().pluginApi().getBeanType(Customer.class).clearBeanCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() throws IOException {
|
public void test() throws IOException {
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ public class TestNewTypes extends BaseTestCase {
|
|||||||
|
|
||||||
private void testSetGetPath(SomeNewTypesBean refBean) {
|
private void testSetGetPath(SomeNewTypesBean refBean) {
|
||||||
SomeNewTypesBean testBean = new SomeNewTypesBean();
|
SomeNewTypesBean testBean = new SomeNewTypesBean();
|
||||||
BeanType<SomeNewTypesBean> beanType = DB.getDefault().getPluginApi().getBeanType(SomeNewTypesBean.class);
|
BeanType<SomeNewTypesBean> beanType = DB.getDefault().pluginApi().getBeanType(SomeNewTypesBean.class);
|
||||||
ExpressionPath localDate = beanType.getExpressionPath("localDate");
|
ExpressionPath localDate = beanType.getExpressionPath("localDate");
|
||||||
ExpressionPath localDateTime = beanType.getExpressionPath("localDateTime");
|
ExpressionPath localDateTime = beanType.getExpressionPath("localDateTime");
|
||||||
ExpressionPath offsetDateTime = beanType.getExpressionPath("offsetDateTime");
|
ExpressionPath offsetDateTime = beanType.getExpressionPath("offsetDateTime");
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class ConditionalTestRunner extends BlockJUnit4ClassRunner {
|
|||||||
|
|
||||||
}
|
}
|
||||||
private boolean platformMath(Platform[] platforms) {
|
private boolean platformMath(Platform[] platforms) {
|
||||||
Platform basePlatform = DB.getDefault().getPlatform().base();
|
Platform basePlatform = DB.getDefault().platform().base();
|
||||||
for (Platform platform : platforms) {
|
for (Platform platform : platforms) {
|
||||||
if (platform.equals(basePlatform)) {
|
if (platform.equals(basePlatform)) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
public class DbMigrationTest extends BaseTestCase {
|
public class DbMigrationTest extends BaseTestCase {
|
||||||
|
|
||||||
private void runScript(boolean expectErrors, String scriptName) throws IOException {
|
private void runScript(boolean expectErrors, String scriptName) throws IOException {
|
||||||
String ddl = Helper.asText(this, "/dbmigration/migrationtest/" + server().getPlatform().name().toLowerCase() + "/" + scriptName);
|
String ddl = Helper.asText(this, "/dbmigration/migrationtest/" + server().platform().name().toLowerCase() + "/" + scriptName);
|
||||||
runScript(expectErrors, ddl, scriptName);
|
runScript(expectErrors, ddl, scriptName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@ public class PlatformDdl_AlterColumnTest {
|
|||||||
private final PlatformDdl hanaDdl = PlatformDdlBuilder.create(new HanaPlatform());
|
private final PlatformDdl hanaDdl = PlatformDdlBuilder.create(new HanaPlatform());
|
||||||
|
|
||||||
{
|
{
|
||||||
DatabaseConfig serverConfig = DB.getDefault().getPluginApi().getServerConfig();
|
DatabaseConfig serverConfig = DB.getDefault().pluginApi().getServerConfig();
|
||||||
sqlServerDdl.configure(serverConfig);
|
sqlServerDdl.configure(serverConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ public class PlatformDdl_CreateIndexTest {
|
|||||||
private final PlatformDdl hanaDdl = PlatformDdlBuilder.create(new HanaPlatform());
|
private final PlatformDdl hanaDdl = PlatformDdlBuilder.create(new HanaPlatform());
|
||||||
|
|
||||||
{
|
{
|
||||||
DatabaseConfig config = DB.getDefault().getPluginApi().getServerConfig();
|
DatabaseConfig config = DB.getDefault().pluginApi().getServerConfig();
|
||||||
h2Ddl.configure(config);
|
h2Ddl.configure(config);
|
||||||
pgDdl.configure(config);
|
pgDdl.configure(config);
|
||||||
mysqlDdl.configure(config);
|
mysqlDdl.configure(config);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class ClusterTest {
|
|||||||
public void testBothNear() {
|
public void testBothNear() {
|
||||||
// ensure the default server exists first
|
// ensure the default server exists first
|
||||||
final Database db = DB.getDefault();
|
final Database db = DB.getDefault();
|
||||||
Database other = createOther(db.getPluginApi().dataSource());
|
Database other = createOther(db.pluginApi().dataSource());
|
||||||
|
|
||||||
new QPerson()
|
new QPerson()
|
||||||
.name.eq("Someone")
|
.name.eq("Someone")
|
||||||
@@ -62,7 +62,7 @@ public class ClusterTest {
|
|||||||
public void test() throws InterruptedException {
|
public void test() throws InterruptedException {
|
||||||
// ensure the default server exists first
|
// ensure the default server exists first
|
||||||
final Database db = DB.getDefault();
|
final Database db = DB.getDefault();
|
||||||
Database other = createOther(db.getPluginApi().dataSource());
|
Database other = createOther(db.pluginApi().dataSource());
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
Person foo = new Person("name " + i);
|
Person foo = new Person("name " + i);
|
||||||
|
|||||||
Reference in new issue
Block a user