Skip to content

Commit

Permalink
#374 - Merge BaseColumnDdl into BaseTableDdl
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave committed Aug 14, 2015
1 parent 851f40e commit 5166fbe
Show file tree
Hide file tree
Showing 9 changed files with 194 additions and 286 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Oracle10Platform extends DatabasePlatform {
public Oracle10Platform() {
super();
this.name = "oracle";
this.maxIntersectionTableName = 30;
this.maxTableNameLength = 30;
// OnQueryOnly.CLOSE as a performance optimisation on Oracle
this.onQueryOnly = OnQueryOnly.CLOSE;
this.dbEncrypt = new Oracle10DbEncrypt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.avaje.ebean.config.DbConstraintNaming;
import com.avaje.ebean.config.NamingConvention;
import com.avaje.ebean.dbmigration.ddlgeneration.platform.BaseColumnDdl;
import com.avaje.ebean.dbmigration.ddlgeneration.platform.BaseTableDdl;
import com.avaje.ebean.dbmigration.ddlgeneration.platform.PlatformDdl;
import com.avaje.ebean.dbmigration.migration.AddColumn;
Expand All @@ -19,13 +18,10 @@
*/
public class BaseDdlHandler implements DdlHandler {

protected final ColumnDdl columnDdl;

protected final TableDdl tableDdl;

public BaseDdlHandler(NamingConvention namingConvention, DbConstraintNaming naming, PlatformDdl platformDdl) {
this.tableDdl = new BaseTableDdl(namingConvention, naming, platformDdl);
this.columnDdl = new BaseColumnDdl(platformDdl);
}

@Override
Expand All @@ -52,16 +48,16 @@ public void generate(DdlWrite writer, CreateTable createTable) throws IOExceptio

@Override
public void generate(DdlWrite writer, AddColumn addColumn) throws IOException {
columnDdl.generate(writer, addColumn);
tableDdl.generate(writer, addColumn);
}

@Override
public void generate(DdlWrite writer, DropColumn dropColumn) throws IOException {
columnDdl.generate(writer, dropColumn);
tableDdl.generate(writer, dropColumn);
}

@Override
public void generate(DdlWrite writer, AlterColumn alterColumn) throws IOException {
columnDdl.generate(writer, alterColumn);
tableDdl.generate(writer, alterColumn);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.avaje.ebean.dbmigration.ddlgeneration;

import com.avaje.ebean.dbmigration.migration.AddColumn;
import com.avaje.ebean.dbmigration.migration.AlterColumn;
import com.avaje.ebean.dbmigration.migration.CreateTable;
import com.avaje.ebean.dbmigration.migration.DropColumn;

import java.io.IOException;

Expand All @@ -13,4 +16,20 @@ public interface TableDdl {
* Generate the create table DDL.
*/
void generate(DdlWrite writer, CreateTable createTable) throws IOException;

/**
* Write the add column change.
*/
void generate(DdlWrite writer, AddColumn addColumn) throws IOException;

/**
* Write the drop column change.
*/
void generate(DdlWrite writer, DropColumn dropColumn) throws IOException;

/**
* Write the alter column changes.
*/
void generate(DdlWrite writer, AlterColumn alterColumn) throws IOException;

}

This file was deleted.

Loading

0 comments on commit 5166fbe

Please sign in to comment.