mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-24 06:12:43 +00:00
Oracle specific changes - Internal changes for DB Migration / DDL generation #369
This commit is contained in:
@@ -113,6 +113,13 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>oracle</groupId>
|
||||
<artifactId>oracle-jdbc</artifactId>
|
||||
<version>7.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.avaje.ebean.config.dbplatform;
|
||||
|
||||
import com.avaje.ebean.BackgroundExecutor;
|
||||
import com.avaje.ebean.dbmigration.ddlgeneration.platform.Oracle10Ddl;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Types;
|
||||
@@ -52,6 +53,8 @@ public class Oracle10Platform extends DatabasePlatform {
|
||||
dbDdlSyntax.setDropTableCascade("cascade constraints purge");
|
||||
dbDdlSyntax.setIdentity(null);
|
||||
dbDdlSyntax.setMaxConstraintNameLength(30);
|
||||
|
||||
this.platformDdl = new Oracle10Ddl(this.dbTypeMap, this.dbIdentity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.avaje.ebean.dbmigration.ddlgeneration.platform;
|
||||
|
||||
import com.avaje.ebean.config.dbplatform.DbIdentity;
|
||||
import com.avaje.ebean.config.dbplatform.DbTypeMap;
|
||||
|
||||
/**
|
||||
* Oracle platform specific DDL.
|
||||
*/
|
||||
public class Oracle10Ddl extends PlatformDdl {
|
||||
|
||||
public Oracle10Ddl(DbTypeMap platformTypes, DbIdentity dbIdentity) {
|
||||
super(platformTypes, dbIdentity);
|
||||
this.historyDdl = new H2HistoryDdl();
|
||||
this.dropTableIfExists = "drop table ";
|
||||
this.dropSequenceIfExists = "drop sequence ";
|
||||
this.dropTableCascade = " cascade constraints purge";
|
||||
this.namingConvention.maxConstraintNameLength = 30;
|
||||
this.foreignKeyRestrict = "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import java.sql.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
@@ -17,6 +18,7 @@ import com.avaje.tests.model.basic.EBasicEncrypt;
|
||||
|
||||
public class TestEncrypt extends BaseTestCase {
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ ebean.cacheWarmingDelay=-1
|
||||
## DataSources (If using default Ebean DataSourceFactory)
|
||||
## -------------------------------------------------------------
|
||||
|
||||
datasource.default=h2
|
||||
datasource.default=ora
|
||||
|
||||
datasource.h2.username=sa
|
||||
datasource.h2.password=
|
||||
@@ -82,7 +82,6 @@ datasource.h2ebasicver.databaseUrl=jdbc:h2:mem:h2ebasicver;DB_CLOSE_DELAY=-1
|
||||
datasource.h2ebasicver.databaseDriver=org.h2.Driver
|
||||
|
||||
|
||||
|
||||
datasource.sqlite.username=
|
||||
datasource.sqlite.password=
|
||||
datasource.sqlite.databaseUrl=jdbc:sqlite:mydb.db
|
||||
@@ -103,12 +102,11 @@ datasource.mysql.databaseUrl=jdbc:mysql://127.0.0.1:3306/test
|
||||
datasource.mysql.databaseDriver=com.mysql.jdbc.Driver
|
||||
|
||||
|
||||
datasource.ora.username=junk
|
||||
datasource.ora.password=junk
|
||||
datasource.ora.databaseUrl=jdbc:oracle:thin:@127.0.0.1:1521:XE
|
||||
datasource.ora.username=unit
|
||||
datasource.ora.password=unit
|
||||
datasource.ora.databaseUrl=jdbc:oracle:thin:@//127.0.0.1:1521/orcl
|
||||
datasource.ora.databaseDriver=oracle.jdbc.driver.OracleDriver
|
||||
|
||||
|
||||
datasource.pg.username=unit
|
||||
datasource.pg.password=unit
|
||||
datasource.pg.databaseUrl=jdbc:postgresql://127.0.0.1:5432/unit
|
||||
|
||||
Reference in New Issue
Block a user