tacitknowledge / autopatch

An automated database patching framework for Java.
41 stars 19 forks source link

Review/fix design for MigrationTaskSupport.name property #30

Closed scottfromsf closed 12 years ago

scottfromsf commented 12 years ago

The MigrationTask interface defines a getName method. MigrationTaskSupport provides a default implementation that includes a corresponding setName method. The problem is that there's nothing to indicate to MigrationTaskSupport subclasses that getName should return something. If getName returns null then the patch is ignored with a message in the log.

hemri commented 12 years ago

It shouldn't be required. MigrationTask.getName() is used for logging purposes and is not related to the execution. For SQL and XML-based patches, the name is set as the name of the file that contains the patch. For Java-based patches it is required. MigrationTaskSupport would provided a default value for getName(), maybe the full qualified name of the Java class.

And the constraint in ClassMigrationTaskSource should be removed.