#910 - SQL Server update - refactor rename platform to SqlServerPlatform

This commit is contained in:
Rob Bygrave
2016-12-03 13:30:17 +13:00
parent a5945b1d5d
commit 5ce31b16d4
6 changed files with 18 additions and 25 deletions
@@ -3,18 +3,18 @@ package com.avaje.ebean.config.dbplatform;
/**
* Use top and row_number() function to limit sql results.
*/
public class MsSqlServer2005SqlLimiter implements SqlLimiter {
public class SqlServer2005SqlLimiter implements SqlLimiter {
final String rowNumberWindowAlias;
/**
* Specify the name of the rowNumberWindowAlias.
*/
public MsSqlServer2005SqlLimiter(String rowNumberWindowAlias) {
public SqlServer2005SqlLimiter(String rowNumberWindowAlias) {
this.rowNumberWindowAlias = rowNumberWindowAlias;
}
public MsSqlServer2005SqlLimiter() {
public SqlServer2005SqlLimiter() {
this("as limitresult");
}
@@ -4,18 +4,11 @@ import com.avaje.ebean.config.PersistBatch;
import com.avaje.ebean.dbmigration.ddlgeneration.platform.MsSqlServerDdl;
/**
* Microsoft SQL Server 2005 specific platform.
* <p>
* <ul>
* <li>supportsGetGeneratedKeys = true</li>
* <li>Uses LIMIT OFFSET clause</li>
* <li>Uses [ & ] for quoted identifiers</li>
* </ul>
* </p>
* Microsoft SQL Server platform.
*/
public class MsSqlServer2005Platform extends DatabasePlatform {
public class SqlServerPlatform extends DatabasePlatform {
public MsSqlServer2005Platform() {
public SqlServerPlatform() {
super();
this.name = "sqlserver";
// effectively disable persistBatchOnCascade mode for SQL Server
@@ -23,7 +16,7 @@ public class MsSqlServer2005Platform extends DatabasePlatform {
this.persistBatchOnCascade = PersistBatch.NONE;
this.idInExpandedForm = true;
this.selectCountWithAlias = true;
this.sqlLimiter = new MsSqlServer2005SqlLimiter();
this.sqlLimiter = new SqlServer2005SqlLimiter();
this.platformDdl = new MsSqlServerDdl(this);
this.dbIdentity.setIdType(IdType.IDENTITY);
this.dbIdentity.setSupportsGetGeneratedKeys(true);
@@ -9,7 +9,7 @@ import com.avaje.ebean.config.ServerConfig;
import com.avaje.ebean.config.dbplatform.DB2Platform;
import com.avaje.ebean.config.dbplatform.DatabasePlatform;
import com.avaje.ebean.config.dbplatform.H2Platform;
import com.avaje.ebean.config.dbplatform.MsSqlServer2005Platform;
import com.avaje.ebean.config.dbplatform.SqlServerPlatform;
import com.avaje.ebean.config.dbplatform.MySqlPlatform;
import com.avaje.ebean.config.dbplatform.OraclePlatform;
import com.avaje.ebean.config.dbplatform.PostgresPlatform;
@@ -526,7 +526,7 @@ public class DbMigration {
case ORACLE:
return new OraclePlatform();
case SQLSERVER:
return new MsSqlServer2005Platform();
return new SqlServerPlatform();
case DB2:
return new DB2Platform();
case SQLITE:
@@ -5,7 +5,7 @@ import com.avaje.ebean.config.dbplatform.DB2Platform;
import com.avaje.ebean.config.dbplatform.DatabasePlatform;
import com.avaje.ebean.config.dbplatform.H2Platform;
import com.avaje.ebean.config.dbplatform.HsqldbPlatform;
import com.avaje.ebean.config.dbplatform.MsSqlServer2005Platform;
import com.avaje.ebean.config.dbplatform.SqlServerPlatform;
import com.avaje.ebean.config.dbplatform.MySqlPlatform;
import com.avaje.ebean.config.dbplatform.OraclePlatform;
import com.avaje.ebean.config.dbplatform.Postgres8Platform;
@@ -85,7 +85,7 @@ public class DatabasePlatformFactory {
return new OraclePlatform();
}
if (dbName.equals("sqlserver")) {
return new MsSqlServer2005Platform();
return new SqlServerPlatform();
}
if (dbName.equals("sqlanywhere")) {
return new SqlAnywherePlatform();
@@ -139,7 +139,7 @@ public class DatabasePlatformFactory {
if (dbProductName.contains("oracle")) {
return new OraclePlatform();
} else if (dbProductName.contains("microsoft")) {
return new MsSqlServer2005Platform();
return new SqlServerPlatform();
} else if (dbProductName.contains("mysql")) {
return new MySqlPlatform();
} else if (dbProductName.contains("h2")) {