diff --git a/src/main/java/com/avaje/ebean/config/dbplatform/MsSqlServer2005SqlLimiter.java b/src/main/java/com/avaje/ebean/config/dbplatform/SqlServer2005SqlLimiter.java similarity index 91% rename from src/main/java/com/avaje/ebean/config/dbplatform/MsSqlServer2005SqlLimiter.java rename to src/main/java/com/avaje/ebean/config/dbplatform/SqlServer2005SqlLimiter.java index 6268b47b2..be7b7d640 100644 --- a/src/main/java/com/avaje/ebean/config/dbplatform/MsSqlServer2005SqlLimiter.java +++ b/src/main/java/com/avaje/ebean/config/dbplatform/SqlServer2005SqlLimiter.java @@ -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"); } diff --git a/src/main/java/com/avaje/ebean/config/dbplatform/MsSqlServer2005Platform.java b/src/main/java/com/avaje/ebean/config/dbplatform/SqlServerPlatform.java similarity index 82% rename from src/main/java/com/avaje/ebean/config/dbplatform/MsSqlServer2005Platform.java rename to src/main/java/com/avaje/ebean/config/dbplatform/SqlServerPlatform.java index f3292c90c..2590dba2f 100644 --- a/src/main/java/com/avaje/ebean/config/dbplatform/MsSqlServer2005Platform.java +++ b/src/main/java/com/avaje/ebean/config/dbplatform/SqlServerPlatform.java @@ -4,18 +4,11 @@ import com.avaje.ebean.config.PersistBatch; import com.avaje.ebean.dbmigration.ddlgeneration.platform.MsSqlServerDdl; /** - * Microsoft SQL Server 2005 specific platform. - *

- *

- *

+ * 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); diff --git a/src/main/java/com/avaje/ebean/dbmigration/DbMigration.java b/src/main/java/com/avaje/ebean/dbmigration/DbMigration.java index e4fda0461..eb19e0103 100644 --- a/src/main/java/com/avaje/ebean/dbmigration/DbMigration.java +++ b/src/main/java/com/avaje/ebean/dbmigration/DbMigration.java @@ -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: diff --git a/src/main/java/com/avaje/ebeaninternal/server/core/DatabasePlatformFactory.java b/src/main/java/com/avaje/ebeaninternal/server/core/DatabasePlatformFactory.java index d410261c2..7918d2178 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/core/DatabasePlatformFactory.java +++ b/src/main/java/com/avaje/ebeaninternal/server/core/DatabasePlatformFactory.java @@ -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")) { diff --git a/src/test/java/com/avaje/ebean/dbmigration/ddlgeneration/platform/PlatformDdl_AlterColumnTest.java b/src/test/java/com/avaje/ebean/dbmigration/ddlgeneration/platform/PlatformDdl_AlterColumnTest.java index b1f5ebf0e..3d1d63704 100644 --- a/src/test/java/com/avaje/ebean/dbmigration/ddlgeneration/platform/PlatformDdl_AlterColumnTest.java +++ b/src/test/java/com/avaje/ebean/dbmigration/ddlgeneration/platform/PlatformDdl_AlterColumnTest.java @@ -1,7 +1,7 @@ package com.avaje.ebean.dbmigration.ddlgeneration.platform; 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; @@ -17,7 +17,7 @@ public class PlatformDdl_AlterColumnTest { PlatformDdl pgDdl = new PostgresPlatform().getPlatformDdl(); PlatformDdl mysqlDdl = new MySqlPlatform().getPlatformDdl(); PlatformDdl oraDdl = new OraclePlatform().getPlatformDdl(); - PlatformDdl sqlServerDdl = new MsSqlServer2005Platform().getPlatformDdl(); + PlatformDdl sqlServerDdl = new SqlServerPlatform().getPlatformDdl(); AlterColumn alterNotNull() { AlterColumn alterColumn = new AlterColumn(); @@ -153,4 +153,4 @@ public class PlatformDdl_AlterColumnTest { assertTrue(sql, sql.startsWith("-- alter")); } -} \ No newline at end of file +} diff --git a/src/test/java/com/avaje/ebean/dbmigration/ddlgeneration/platform/PlatformDdl_dropUniqueConstraintTest.java b/src/test/java/com/avaje/ebean/dbmigration/ddlgeneration/platform/PlatformDdl_dropUniqueConstraintTest.java index 9db08611a..b39f44734 100644 --- a/src/test/java/com/avaje/ebean/dbmigration/ddlgeneration/platform/PlatformDdl_dropUniqueConstraintTest.java +++ b/src/test/java/com/avaje/ebean/dbmigration/ddlgeneration/platform/PlatformDdl_dropUniqueConstraintTest.java @@ -1,7 +1,7 @@ package com.avaje.ebean.dbmigration.ddlgeneration.platform; 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; @@ -16,7 +16,7 @@ public class PlatformDdl_dropUniqueConstraintTest { PlatformDdl pgDdl = new PostgresPlatform().getPlatformDdl(); PlatformDdl mysqlDdl = new MySqlPlatform().getPlatformDdl(); PlatformDdl oraDdl = new OraclePlatform().getPlatformDdl(); - PlatformDdl sqlServerDdl = new MsSqlServer2005Platform().getPlatformDdl(); + PlatformDdl sqlServerDdl = new SqlServerPlatform().getPlatformDdl(); @Test public void test() throws Exception { @@ -35,4 +35,4 @@ public class PlatformDdl_dropUniqueConstraintTest { assertEquals("alter table mytab drop index uq_name", sql); } -} \ No newline at end of file +}