Search in sources :

Example 1 with SQLitePlatform

use of com.avaje.ebean.config.dbplatform.SQLitePlatform in project Glowstone by GlowstoneMC.

the class GlowServer method configureDbConfig.

@Override
public void configureDbConfig(com.avaje.ebean.config.ServerConfig dbConfig) {
    DataSourceConfig ds = new DataSourceConfig();
    ds.setDriver(config.getString(Key.DB_DRIVER));
    ds.setUrl(config.getString(Key.DB_URL));
    ds.setUsername(config.getString(Key.DB_USERNAME));
    ds.setPassword(config.getString(Key.DB_PASSWORD));
    ds.setIsolationLevel(TransactionIsolation.getLevel(config.getString(Key.DB_ISOLATION)));
    if (ds.getDriver().contains("sqlite")) {
        dbConfig.setDatabasePlatform(new SQLitePlatform());
        dbConfig.getDatabasePlatform().getDbDdlSyntax().setIdentity("");
    }
    dbConfig.setDataSourceConfig(ds);
}
Also used : DataSourceConfig(com.avaje.ebean.config.DataSourceConfig) SQLitePlatform(com.avaje.ebean.config.dbplatform.SQLitePlatform)

Aggregations

DataSourceConfig (com.avaje.ebean.config.DataSourceConfig)1 SQLitePlatform (com.avaje.ebean.config.dbplatform.SQLitePlatform)1