Permalink
Browse files

Renamed ChangeClass annotation to DatabaseChange

  • Loading branch information...
1 parent 8e9c63b commit 03a19c5cd675ed5616599727d2afeabbe49f7488 @nvoxland nvoxland committed Aug 29, 2012
Showing with 83 additions and 111 deletions.
  1. +5 −5 liquibase-core/src/main/java/liquibase/change/AbstractChange.java
  2. +14 −14 liquibase-core/src/main/java/liquibase/change/{ChangeClass.java → DatabaseChange.java}
  3. +2 −3 liquibase-core/src/main/java/liquibase/change/core/AddAutoIncrementChange.java
  4. +1 −1 liquibase-core/src/main/java/liquibase/change/core/AddColumnChange.java
  5. +1 −2 liquibase-core/src/main/java/liquibase/change/core/AddDefaultValueChange.java
  6. +1 −1 liquibase-core/src/main/java/liquibase/change/core/AddForeignKeyConstraintChange.java
  7. +1 −1 liquibase-core/src/main/java/liquibase/change/core/AddLookupTableChange.java
  8. +1 −1 liquibase-core/src/main/java/liquibase/change/core/AddNotNullConstraintChange.java
  9. +1 −2 liquibase-core/src/main/java/liquibase/change/core/AddPrimaryKeyChange.java
  10. +1 −2 liquibase-core/src/main/java/liquibase/change/core/AddUniqueConstraintChange.java
  11. +2 −3 liquibase-core/src/main/java/liquibase/change/core/AlterSequenceChange.java
  12. +2 −2 liquibase-core/src/main/java/liquibase/change/core/AnonymousChange.java
  13. +1 −2 liquibase-core/src/main/java/liquibase/change/core/CreateIndexChange.java
  14. +2 −2 liquibase-core/src/main/java/liquibase/change/core/CreateProcedureChange.java
  15. +1 −2 liquibase-core/src/main/java/liquibase/change/core/CreateSequenceChange.java
  16. +1 −1 liquibase-core/src/main/java/liquibase/change/core/CreateTableChange.java
  17. +1 −3 liquibase-core/src/main/java/liquibase/change/core/CreateViewChange.java
  18. +1 −2 liquibase-core/src/main/java/liquibase/change/core/DeleteDataChange.java
  19. +2 −2 liquibase-core/src/main/java/liquibase/change/core/DropAllForeignKeyConstraintsChange.java
  20. +1 −2 liquibase-core/src/main/java/liquibase/change/core/DropColumnChange.java
  21. +1 −2 liquibase-core/src/main/java/liquibase/change/core/DropDefaultValueChange.java
  22. +2 −2 liquibase-core/src/main/java/liquibase/change/core/DropForeignKeyConstraintChange.java
  23. +2 −3 liquibase-core/src/main/java/liquibase/change/core/DropIndexChange.java
  24. +1 −2 liquibase-core/src/main/java/liquibase/change/core/DropNotNullConstraintChange.java
  25. +1 −2 liquibase-core/src/main/java/liquibase/change/core/DropPrimaryKeyChange.java
  26. +2 −3 liquibase-core/src/main/java/liquibase/change/core/DropSequenceChange.java
  27. +2 −3 liquibase-core/src/main/java/liquibase/change/core/DropTableChange.java
  28. +1 −2 liquibase-core/src/main/java/liquibase/change/core/DropUniqueConstraintChange.java
  29. +2 −3 liquibase-core/src/main/java/liquibase/change/core/DropViewChange.java
  30. +2 −2 liquibase-core/src/main/java/liquibase/change/core/EmptyChange.java
  31. +2 −2 liquibase-core/src/main/java/liquibase/change/core/ExecuteShellCommandChange.java
  32. +1 −1 liquibase-core/src/main/java/liquibase/change/core/InsertDataChange.java
  33. +1 −1 liquibase-core/src/main/java/liquibase/change/core/LoadDataChange.java
  34. +2 −2 liquibase-core/src/main/java/liquibase/change/core/LoadUpdateDataChange.java
  35. +1 −2 liquibase-core/src/main/java/liquibase/change/core/MergeColumnChange.java
  36. +2 −2 liquibase-core/src/main/java/liquibase/change/core/ModifyDataTypeChange.java
  37. +2 −2 liquibase-core/src/main/java/liquibase/change/core/RawSQLChange.java
  38. +1 −2 liquibase-core/src/main/java/liquibase/change/core/RenameColumnChange.java
  39. +1 −2 liquibase-core/src/main/java/liquibase/change/core/RenameTableChange.java
  40. +1 −2 liquibase-core/src/main/java/liquibase/change/core/RenameViewChange.java
  41. +1 −5 liquibase-core/src/main/java/liquibase/change/core/SQLFileChange.java
  42. +2 −2 liquibase-core/src/main/java/liquibase/change/core/StopChange.java
  43. +1 −1 liquibase-core/src/main/java/liquibase/change/core/TagDatabaseChange.java
  44. +1 −2 liquibase-core/src/main/java/liquibase/change/core/UpdateDataChange.java
  45. +2 −2 liquibase-core/src/main/java/liquibase/change/custom/CustomChangeWrapper.java
  46. +2 −2 samples/liquibase-ext-change/src/main/java/liquibase/ext/changesample/SampleChange.java
  47. +2 −2 ...t-changewithnestedtags/src/main/java/liquibase/ext/changewithnestedtags/ChangeWithNestedTags.java
@@ -56,15 +56,15 @@ public AbstractChange() {
}
/**
- * Generate the ChangeMetaData for this class. By default reads from the @ChangeClass annotation, but can return anything
+ * Generate the ChangeMetaData for this class. By default reads from the @DatabaseChange annotation, but can return anything
* @return
*/
protected ChangeMetaData createChangeMetaData() {
try {
- ChangeClass changeClass = this.getClass().getAnnotation(ChangeClass.class);
+ DatabaseChange databaseChange = this.getClass().getAnnotation(DatabaseChange.class);
- if (changeClass == null) {
- throw new UnexpectedLiquibaseException("No @ChangeClass annotation for "+getClass().getName());
+ if (databaseChange == null) {
+ throw new UnexpectedLiquibaseException("No @DatabaseChange annotation for "+getClass().getName());
}
Set<ChangeParameterMetaData> params = new HashSet<ChangeParameterMetaData>();
@@ -82,7 +82,7 @@ protected ChangeMetaData createChangeMetaData() {
}
- return new ChangeMetaData(changeClass.name(), changeClass.description(), changeClass.priority(), changeClass.appliesTo(), params);
+ return new ChangeMetaData(databaseChange.name(), databaseChange.description(), databaseChange.priority(), databaseChange.appliesTo(), params);
} catch (Throwable e) {
throw new UnexpectedLiquibaseException(e);
}
@@ -1,14 +1,14 @@
-package liquibase.change;
-
-import java.lang.annotation.*;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-@Inherited
-public @interface ChangeClass {
- String name();
- String description();
- int priority();
- String[] appliesTo() default {"all"};
-
-}
+package liquibase.change;
+
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Inherited
+public @interface DatabaseChange {
+ String name();
+ String description();
+ int priority();
+ String[] appliesTo() default {"all"};
+
+}
@@ -3,7 +3,7 @@
import java.math.BigInteger;
import liquibase.change.AbstractChange;
-import liquibase.change.ChangeClass;
+import liquibase.change.DatabaseChange;
import liquibase.change.ChangeMetaData;
import liquibase.change.ChangeProperty;
import liquibase.database.Database;
@@ -14,14 +14,13 @@
import liquibase.statement.core.AddDefaultValueStatement;
import liquibase.statement.core.CreateSequenceStatement;
import liquibase.statement.core.SetNullableStatement;
-import liquibase.util.StringUtils;
/**
* Makes an existing column into an auto-increment column.
* This change is only valid for databases with auto-increment/identity columns.
* The current version does not support MS-SQL.
*/
-@ChangeClass(name="addAutoIncrement", description = "Set Column as Auto-Increment", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
+@DatabaseChange(name="addAutoIncrement", description = "Set Column as Auto-Increment", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
public class AddAutoIncrementChange extends AbstractChange {
private String catalogName;
@@ -20,7 +20,7 @@
/**
* Adds a column to an existing table.
*/
-@ChangeClass(name="addColumn", description = "Add Column", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "table")
+@DatabaseChange(name="addColumn", description = "Add Column", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "table")
public class AddColumnChange extends AbstractChange implements ChangeWithColumns<ColumnConfig> {
private String catalogName;
@@ -6,7 +6,6 @@
import liquibase.statement.DatabaseFunction;
import liquibase.statement.core.AddDefaultValueStatement;
import liquibase.util.ISODateFormat;
-import liquibase.util.StringUtils;
import java.text.NumberFormat;
import java.text.ParseException;
@@ -15,7 +14,7 @@
/**
* Sets a new default value to an existing column.
*/
-@ChangeClass(name="addDefaultValue", description = "Add Default Value", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
+@DatabaseChange(name="addDefaultValue", description = "Add Default Value", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
public class AddDefaultValueChange extends AbstractChange {
private String catalogName;
@@ -10,7 +10,7 @@
/**
* Adds a foreign key constraint to an existing column.
*/
- @ChangeClass(name="addForeignKeyConstraint", description = "Add Foreign Key Constraint", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
+ @DatabaseChange(name="addForeignKeyConstraint", description = "Add Foreign Key Constraint", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
public class AddForeignKeyConstraintChange extends AbstractChange {
private String baseTableCatalogName;
@@ -19,7 +19,7 @@
* Extracts data from an existing column to create a lookup table.
* A foreign key is created between the old column and the new lookup table.
*/
-@ChangeClass(name="addLookupTable", description = "Add Lookup Table", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
+@DatabaseChange(name="addLookupTable", description = "Add Lookup Table", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
public class AddLookupTableChange extends AbstractChange {
private String existingTableCatalogName;
@@ -18,7 +18,7 @@
/**
* Adds a not-null constraint to an existing column.
*/
-@ChangeClass(name="addNotNullConstraint", description = "Add Not-Null Constraint", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
+@DatabaseChange(name="addNotNullConstraint", description = "Add Not-Null Constraint", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
public class AddNotNullConstraintChange extends AbstractChange {
private String catalogName;
private String schemaName;
@@ -9,15 +9,14 @@
import liquibase.statement.SqlStatement;
import liquibase.statement.core.AddPrimaryKeyStatement;
import liquibase.statement.core.ReorganizeTableStatement;
-import liquibase.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Creates a primary key out of an existing column or set of columns.
*/
-@ChangeClass(name="addPrimaryKey", description = "Add Primary Key", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
+@DatabaseChange(name="addPrimaryKey", description = "Add Primary Key", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
public class AddPrimaryKeyChange extends AbstractChange {
private String catalogName;
@@ -7,15 +7,14 @@
import liquibase.database.structure.Index;
import liquibase.statement.SqlStatement;
import liquibase.statement.core.AddUniqueConstraintStatement;
-import liquibase.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Adds a unique constraint to an existing column.
*/
-@ChangeClass(name="addUniqueConstraint", description = "Add Unique Constraint", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
+@DatabaseChange(name="addUniqueConstraint", description = "Add Unique Constraint", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
public class AddUniqueConstraintChange extends AbstractChange {
private String catalogName;
@@ -1,20 +1,19 @@
package liquibase.change.core;
import liquibase.change.AbstractChange;
-import liquibase.change.ChangeClass;
+import liquibase.change.DatabaseChange;
import liquibase.change.ChangeMetaData;
import liquibase.change.ChangeProperty;
import liquibase.database.Database;
import liquibase.statement.SqlStatement;
import liquibase.statement.core.AlterSequenceStatement;
-import liquibase.util.StringUtils;
import java.math.BigInteger;
/**
* Modifies properties of an existing sequence.
*/
-@ChangeClass(name="alterSequence", description = "Alter Sequence", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "sequence")
+@DatabaseChange(name="alterSequence", description = "Alter Sequence", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "sequence")
public class AlterSequenceChange extends AbstractChange {
private String catalogName;
@@ -1,7 +1,7 @@
package liquibase.change.core;
import liquibase.change.AbstractChange;
-import liquibase.change.ChangeClass;
+import liquibase.change.DatabaseChange;
import liquibase.change.ChangeMetaData;
import liquibase.change.ChangeProperty;
import liquibase.database.Database;
@@ -11,7 +11,7 @@
import java.util.Arrays;
import java.util.List;
-@ChangeClass(name="anonymous", description = "Anonymous change", priority = ChangeMetaData.PRIORITY_DEFAULT)
+@DatabaseChange(name="anonymous", description = "Anonymous change", priority = ChangeMetaData.PRIORITY_DEFAULT)
public class AnonymousChange extends AbstractChange {
@ChangeProperty(includeInSerialization = false)
@@ -4,15 +4,14 @@
import liquibase.database.Database;
import liquibase.statement.SqlStatement;
import liquibase.statement.core.CreateIndexStatement;
-import liquibase.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Creates an index on an existing column.
*/
-@ChangeClass(name="createIndex", description = "Create Index", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "index")
+@DatabaseChange(name="createIndex", description = "Create Index", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "index")
public class CreateIndexChange extends AbstractChange implements ChangeWithColumns<ColumnConfig> {
private String schemaName;
@@ -1,7 +1,7 @@
package liquibase.change.core;
import liquibase.change.AbstractChange;
-import liquibase.change.ChangeClass;
+import liquibase.change.DatabaseChange;
import liquibase.change.ChangeMetaData;
import liquibase.change.ChangeProperty;
import liquibase.database.Database;
@@ -10,7 +10,7 @@
import liquibase.statement.SqlStatement;
import liquibase.statement.core.RawSqlStatement;
-@ChangeClass(name = "createProcedure", description = "Create Procedure", priority = ChangeMetaData.PRIORITY_DEFAULT)
+@DatabaseChange(name = "createProcedure", description = "Create Procedure", priority = ChangeMetaData.PRIORITY_DEFAULT)
public class CreateProcedureChange extends AbstractChange {
private String comments;
private String procedureBody;
@@ -4,14 +4,13 @@
import liquibase.database.Database;
import liquibase.statement.SqlStatement;
import liquibase.statement.core.CreateSequenceStatement;
-import liquibase.util.StringUtils;
import java.math.BigInteger;
/**
* Creates a new sequence.
*/
-@ChangeClass(name="createSequence", description = "Create Sequence", priority = ChangeMetaData.PRIORITY_DEFAULT)
+@DatabaseChange(name="createSequence", description = "Create Sequence", priority = ChangeMetaData.PRIORITY_DEFAULT)
public class CreateSequenceChange extends AbstractChange {
private String catalogName;
@@ -18,7 +18,7 @@
/**
* Creates a new table.
*/
-@ChangeClass(name="createTable", description = "Create Table", priority = ChangeMetaData.PRIORITY_DEFAULT)
+@DatabaseChange(name="createTable", description = "Create Table", priority = ChangeMetaData.PRIORITY_DEFAULT)
public class CreateTableChange extends AbstractChange implements ChangeWithColumns<ColumnConfig> {
private List<ColumnConfig> columns;
@@ -2,20 +2,18 @@
import liquibase.change.*;
import liquibase.database.Database;
-import liquibase.database.core.MSSQLDatabase;
import liquibase.database.core.SQLiteDatabase;
import liquibase.statement.SqlStatement;
import liquibase.statement.core.CreateViewStatement;
import liquibase.statement.core.DropViewStatement;
-import liquibase.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Creates a new view.
*/
-@ChangeClass(name="createView", description = "Create View", priority = ChangeMetaData.PRIORITY_DEFAULT)
+@DatabaseChange(name="createView", description = "Create View", priority = ChangeMetaData.PRIORITY_DEFAULT)
public class CreateViewChange extends AbstractChange {
private String catalogName;
@@ -4,9 +4,8 @@
import liquibase.database.Database;
import liquibase.statement.SqlStatement;
import liquibase.statement.core.DeleteStatement;
-import liquibase.util.StringUtils;
-@ChangeClass(name="delete", description = "Delete Data", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "table")
+@DatabaseChange(name="delete", description = "Delete Data", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "table")
public class DeleteDataChange extends AbstractChange {
private String catalogName;
@@ -1,7 +1,7 @@
package liquibase.change.core;
import liquibase.change.AbstractChange;
-import liquibase.change.ChangeClass;
+import liquibase.change.DatabaseChange;
import liquibase.change.ChangeMetaData;
import liquibase.change.ChangeProperty;
import liquibase.database.Database;
@@ -20,7 +20,7 @@
import java.util.Map;
import java.util.Set;
-@ChangeClass(name="dropAllForeignKeyConstraints", description = "Drop All Foreign Key Constraints", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "table")
+@DatabaseChange(name="dropAllForeignKeyConstraints", description = "Drop All Foreign Key Constraints", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "table")
public class DropAllForeignKeyConstraintsChange extends AbstractChange {
private String baseTableCatalogName;
@@ -9,15 +9,14 @@
import liquibase.statement.SqlStatement;
import liquibase.statement.core.DropColumnStatement;
import liquibase.statement.core.ReorganizeTableStatement;
-import liquibase.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Drops an existing column from a table.
*/
-@ChangeClass(name="dropColumn", description = "Drop Column", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
+@DatabaseChange(name="dropColumn", description = "Drop Column", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
public class DropColumnChange extends AbstractChange {
private String catalogName;
@@ -7,7 +7,6 @@
import liquibase.database.structure.Index;
import liquibase.statement.SqlStatement;
import liquibase.statement.core.DropDefaultValueStatement;
-import liquibase.util.StringUtils;
import java.util.ArrayList;
import java.util.Date;
@@ -16,7 +15,7 @@
/**
* Removes the default value from an existing column.
*/
-@ChangeClass(name="dropDefaultValue", description="Drop Default Value", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
+@DatabaseChange(name="dropDefaultValue", description="Drop Default Value", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "column")
public class DropDefaultValueChange extends AbstractChange {
private String catalogName;
@@ -1,7 +1,7 @@
package liquibase.change.core;
import liquibase.change.AbstractChange;
-import liquibase.change.ChangeClass;
+import liquibase.change.DatabaseChange;
import liquibase.change.ChangeMetaData;
import liquibase.change.ChangeProperty;
import liquibase.database.Database;
@@ -12,7 +12,7 @@
/**
* Drops an existing foreign key constraint.
*/
-@ChangeClass(name="dropForeignKeyConstraint", description = "Drop Foreign Key Constraint", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "foreignKey")
+@DatabaseChange(name="dropForeignKeyConstraint", description = "Drop Foreign Key Constraint", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "foreignKey")
public class DropForeignKeyConstraintChange extends AbstractChange {
private String baseTableCatalogName;
private String baseTableSchemaName;
@@ -1,18 +1,17 @@
package liquibase.change.core;
import liquibase.change.AbstractChange;
-import liquibase.change.ChangeClass;
+import liquibase.change.DatabaseChange;
import liquibase.change.ChangeMetaData;
import liquibase.change.ChangeProperty;
import liquibase.database.Database;
import liquibase.statement.SqlStatement;
import liquibase.statement.core.DropIndexStatement;
-import liquibase.util.StringUtils;
/**
* Drops an existing index.
*/
-@ChangeClass(name="dropIndex", description = "Drop Index", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "index")
+@DatabaseChange(name="dropIndex", description = "Drop Index", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "index")
public class DropIndexChange extends AbstractChange {
private String schemaName;
Oops, something went wrong.

0 comments on commit 03a19c5

Please sign in to comment.