diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-09-13 16:15:52 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-09-16 12:22:11 +0200 |
commit | ec3da287e305f793d28969f2dfda201de4dac00f (patch) | |
tree | 55d384519b8c0e70d55af3dc4ddeeefb70af4b90 /sonar-db/src | |
parent | 2e84653bc48ef8e7321ace4468c1eb9f5edaaa55 (diff) | |
download | sonarqube-ec3da287e305f793d28969f2dfda201de4dac00f.tar.gz sonarqube-ec3da287e305f793d28969f2dfda201de4dac00f.zip |
SONAR-8025 rename BigDecimalColumnDef to BigIntegerColumnDef
Diffstat (limited to 'sonar-db/src')
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/version/BigIntegerColumnDef.java (renamed from sonar-db/src/main/java/org/sonar/db/version/BigDecimalColumnDef.java) | 10 | ||||
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/version/v51/AddIssuesColumns.java | 8 | ||||
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/version/v55/AddActiveRulesLongDateColumns.java | 6 | ||||
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/version/v55/AddRulesColumns.java | 6 | ||||
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/version/v60/AddLastUsedColumnToRulesProfiles.java | 4 | ||||
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/version/v60/AddUserUpdatedAtToRulesProfiles.java | 4 | ||||
-rw-r--r-- | sonar-db/src/test/java/org/sonar/db/version/AddColumnsBuilderTest.java | 2 | ||||
-rw-r--r-- | sonar-db/src/test/java/org/sonar/db/version/BigIntegerColumnDefTest.java (renamed from sonar-db/src/test/java/org/sonar/db/version/BigDecimalColumnDefTest.java) | 12 |
8 files changed, 26 insertions, 26 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/version/BigDecimalColumnDef.java b/sonar-db/src/main/java/org/sonar/db/version/BigIntegerColumnDef.java index a408f789f9a..687ce188304 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/BigDecimalColumnDef.java +++ b/sonar-db/src/main/java/org/sonar/db/version/BigIntegerColumnDef.java @@ -25,13 +25,13 @@ import org.sonar.db.dialect.Oracle; import static org.sonar.db.version.ColumnDefValidation.validateColumnName; -public class BigDecimalColumnDef extends AbstractColumnDef { +public class BigIntegerColumnDef extends AbstractColumnDef { - private BigDecimalColumnDef(Builder builder) { + private BigIntegerColumnDef(Builder builder) { super(builder.columnName, builder.isNullable); } - public static Builder newBigDecimalColumnDefBuilder() { + public static Builder newBigIntegerColumnDefBuilder() { return new Builder(); } @@ -56,9 +56,9 @@ public class BigDecimalColumnDef extends AbstractColumnDef { return this; } - public BigDecimalColumnDef build() { + public BigIntegerColumnDef build() { validateColumnName(columnName); - return new BigDecimalColumnDef(this); + return new BigIntegerColumnDef(this); } } diff --git a/sonar-db/src/main/java/org/sonar/db/version/v51/AddIssuesColumns.java b/sonar-db/src/main/java/org/sonar/db/version/v51/AddIssuesColumns.java index 6eeaeb3166d..6e567a832eb 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/v51/AddIssuesColumns.java +++ b/sonar-db/src/main/java/org/sonar/db/version/v51/AddIssuesColumns.java @@ -24,7 +24,7 @@ import org.sonar.db.Database; import org.sonar.db.version.AddColumnsBuilder; import org.sonar.db.version.DdlChange; -import static org.sonar.db.version.BigDecimalColumnDef.newBigDecimalColumnDefBuilder; +import static org.sonar.db.version.BigIntegerColumnDef.newBigIntegerColumnDefBuilder; import static org.sonar.db.version.VarcharColumnDef.newVarcharColumnDefBuilder; /** @@ -49,9 +49,9 @@ public class AddIssuesColumns extends DdlChange { private String generateSql() { return new AddColumnsBuilder(getDialect(), "issues") - .addColumn(newBigDecimalColumnDefBuilder().setColumnName("issue_creation_date_ms").setIsNullable(true).build()) - .addColumn(newBigDecimalColumnDefBuilder().setColumnName("issue_update_date_ms").setIsNullable(true).build()) - .addColumn(newBigDecimalColumnDefBuilder().setColumnName("issue_close_date_ms").setIsNullable(true).build()) + .addColumn(newBigIntegerColumnDefBuilder().setColumnName("issue_creation_date_ms").setIsNullable(true).build()) + .addColumn(newBigIntegerColumnDefBuilder().setColumnName("issue_update_date_ms").setIsNullable(true).build()) + .addColumn(newBigIntegerColumnDefBuilder().setColumnName("issue_close_date_ms").setIsNullable(true).build()) .addColumn(newVarcharColumnDefBuilder().setColumnName("tags").setLimit(4000).setIsNullable(true).build()) .addColumn(newVarcharColumnDefBuilder().setColumnName("component_uuid").setLimit(50).setIsNullable(true).build()) .addColumn(newVarcharColumnDefBuilder().setColumnName("project_uuid").setLimit(50).setIsNullable(true).build()) diff --git a/sonar-db/src/main/java/org/sonar/db/version/v55/AddActiveRulesLongDateColumns.java b/sonar-db/src/main/java/org/sonar/db/version/v55/AddActiveRulesLongDateColumns.java index f9e381b226d..8e68cd2d2a5 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/v55/AddActiveRulesLongDateColumns.java +++ b/sonar-db/src/main/java/org/sonar/db/version/v55/AddActiveRulesLongDateColumns.java @@ -24,7 +24,7 @@ import org.sonar.db.Database; import org.sonar.db.version.AddColumnsBuilder; import org.sonar.db.version.DdlChange; -import static org.sonar.db.version.BigDecimalColumnDef.newBigDecimalColumnDefBuilder; +import static org.sonar.db.version.BigIntegerColumnDef.newBigIntegerColumnDefBuilder; /** * Add the following columns to the active_rules table : @@ -44,8 +44,8 @@ public class AddActiveRulesLongDateColumns extends DdlChange { private String generateSql() { return new AddColumnsBuilder(getDialect(), "active_rules") - .addColumn(newBigDecimalColumnDefBuilder().setColumnName("created_at_ms").setIsNullable(true).build()) - .addColumn(newBigDecimalColumnDefBuilder().setColumnName("updated_at_ms").setIsNullable(true).build()) + .addColumn(newBigIntegerColumnDefBuilder().setColumnName("created_at_ms").setIsNullable(true).build()) + .addColumn(newBigIntegerColumnDefBuilder().setColumnName("updated_at_ms").setIsNullable(true).build()) .build(); } diff --git a/sonar-db/src/main/java/org/sonar/db/version/v55/AddRulesColumns.java b/sonar-db/src/main/java/org/sonar/db/version/v55/AddRulesColumns.java index 400b4c7702f..9ab16db051d 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/v55/AddRulesColumns.java +++ b/sonar-db/src/main/java/org/sonar/db/version/v55/AddRulesColumns.java @@ -25,7 +25,7 @@ import org.sonar.db.version.AddColumnsBuilder; import org.sonar.db.version.DdlChange; import org.sonar.db.version.TinyIntColumnDef; -import static org.sonar.db.version.BigDecimalColumnDef.newBigDecimalColumnDefBuilder; +import static org.sonar.db.version.BigIntegerColumnDef.newBigIntegerColumnDefBuilder; /** * Add the following columns to the rules table : @@ -46,8 +46,8 @@ public class AddRulesColumns extends DdlChange { private String generateSql() { return new AddColumnsBuilder(getDialect(), "rules") - .addColumn(newBigDecimalColumnDefBuilder().setColumnName("created_at_ms").setIsNullable(true).build()) - .addColumn(newBigDecimalColumnDefBuilder().setColumnName("updated_at_ms").setIsNullable(true).build()) + .addColumn(newBigIntegerColumnDefBuilder().setColumnName("created_at_ms").setIsNullable(true).build()) + .addColumn(newBigIntegerColumnDefBuilder().setColumnName("updated_at_ms").setIsNullable(true).build()) .addColumn(new TinyIntColumnDef.Builder().setColumnName("rule_type").setIsNullable(true).build()) .build(); } diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/AddLastUsedColumnToRulesProfiles.java b/sonar-db/src/main/java/org/sonar/db/version/v60/AddLastUsedColumnToRulesProfiles.java index bcdcfe4cf2a..74759d242be 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/AddLastUsedColumnToRulesProfiles.java +++ b/sonar-db/src/main/java/org/sonar/db/version/v60/AddLastUsedColumnToRulesProfiles.java @@ -25,7 +25,7 @@ import org.sonar.db.Database; import org.sonar.db.version.AddColumnsBuilder; import org.sonar.db.version.DdlChange; -import static org.sonar.db.version.BigDecimalColumnDef.newBigDecimalColumnDefBuilder; +import static org.sonar.db.version.BigIntegerColumnDef.newBigIntegerColumnDefBuilder; public class AddLastUsedColumnToRulesProfiles extends DdlChange { @@ -38,7 +38,7 @@ public class AddLastUsedColumnToRulesProfiles extends DdlChange { @Override public void execute(Context context) throws SQLException { context.execute(new AddColumnsBuilder(getDatabase().getDialect(), TABLE_QUALITY_PROFILES) - .addColumn(newBigDecimalColumnDefBuilder().setColumnName("last_used").setIsNullable(true).build()) + .addColumn(newBigIntegerColumnDefBuilder().setColumnName("last_used").setIsNullable(true).build()) .build()); } diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/AddUserUpdatedAtToRulesProfiles.java b/sonar-db/src/main/java/org/sonar/db/version/v60/AddUserUpdatedAtToRulesProfiles.java index 4935ab7ad15..3d836b4c0fd 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/AddUserUpdatedAtToRulesProfiles.java +++ b/sonar-db/src/main/java/org/sonar/db/version/v60/AddUserUpdatedAtToRulesProfiles.java @@ -25,7 +25,7 @@ import org.sonar.db.Database; import org.sonar.db.version.AddColumnsBuilder; import org.sonar.db.version.DdlChange; -import static org.sonar.db.version.BigDecimalColumnDef.newBigDecimalColumnDefBuilder; +import static org.sonar.db.version.BigIntegerColumnDef.newBigIntegerColumnDefBuilder; public class AddUserUpdatedAtToRulesProfiles extends DdlChange { @@ -38,7 +38,7 @@ public class AddUserUpdatedAtToRulesProfiles extends DdlChange { @Override public void execute(Context context) throws SQLException { context.execute(new AddColumnsBuilder(getDatabase().getDialect(), TABLE_QUALITY_PROFILES) - .addColumn(newBigDecimalColumnDefBuilder().setColumnName("user_updated_at").setIsNullable(true).build()) + .addColumn(newBigIntegerColumnDefBuilder().setColumnName("user_updated_at").setIsNullable(true).build()) .build()); } diff --git a/sonar-db/src/test/java/org/sonar/db/version/AddColumnsBuilderTest.java b/sonar-db/src/test/java/org/sonar/db/version/AddColumnsBuilderTest.java index de35cfbda0d..d2df1bec86f 100644 --- a/sonar-db/src/test/java/org/sonar/db/version/AddColumnsBuilderTest.java +++ b/sonar-db/src/test/java/org/sonar/db/version/AddColumnsBuilderTest.java @@ -77,7 +77,7 @@ public class AddColumnsBuilderTest { private AddColumnsBuilder createSampleBuilder(Dialect dialect) { return new AddColumnsBuilder(dialect, TABLE_NAME) - .addColumn(new BigDecimalColumnDef.Builder().setColumnName("date_in_ms").setIsNullable(true).build()) + .addColumn(new BigIntegerColumnDef.Builder().setColumnName("date_in_ms").setIsNullable(true).build()) .addColumn(new VarcharColumnDef.Builder().setColumnName("name").setLimit(10).setIsNullable(false).build()); } } diff --git a/sonar-db/src/test/java/org/sonar/db/version/BigDecimalColumnDefTest.java b/sonar-db/src/test/java/org/sonar/db/version/BigIntegerColumnDefTest.java index e1c5c940365..0c549a0c9ea 100644 --- a/sonar-db/src/test/java/org/sonar/db/version/BigDecimalColumnDefTest.java +++ b/sonar-db/src/test/java/org/sonar/db/version/BigIntegerColumnDefTest.java @@ -30,14 +30,14 @@ import org.sonar.db.dialect.PostgreSql; import static org.assertj.core.api.Assertions.assertThat; -public class BigDecimalColumnDefTest { +public class BigIntegerColumnDefTest { @Rule public ExpectedException thrown = ExpectedException.none(); @Test public void build_string_column_def() throws Exception { - BigDecimalColumnDef def = new BigDecimalColumnDef.Builder() + BigIntegerColumnDef def = new BigIntegerColumnDef.Builder() .setColumnName("issues") .setIsNullable(true) .build(); @@ -48,7 +48,7 @@ public class BigDecimalColumnDefTest { @Test public void build_string_column_def_with_default_values() throws Exception { - BigDecimalColumnDef def = new BigDecimalColumnDef.Builder() + BigIntegerColumnDef def = new BigIntegerColumnDef.Builder() .setColumnName("issues") .build(); @@ -58,7 +58,7 @@ public class BigDecimalColumnDefTest { @Test public void generate_sql_type() throws Exception { - BigDecimalColumnDef def = new BigDecimalColumnDef.Builder() + BigIntegerColumnDef def = new BigIntegerColumnDef.Builder() .setColumnName("issues") .setIsNullable(true) .build(); @@ -75,7 +75,7 @@ public class BigDecimalColumnDefTest { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); - new BigDecimalColumnDef.Builder() + new BigIntegerColumnDef.Builder() .setColumnName(null); } @@ -84,7 +84,7 @@ public class BigDecimalColumnDefTest { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); - new BigDecimalColumnDef.Builder() + new BigIntegerColumnDef.Builder() .build(); } |