Skip to content

Commit

Permalink
HHH-15962 Provide simple default impl for new members of `SchemaManag…
Browse files Browse the repository at this point in the history
…ementTool` interface

- make both `getSchemaTruncator/buildGenerationTargets` as default methods throwing `UnsupportedOperationException`
  • Loading branch information
marko-bekhta authored and beikov committed Jan 3, 2023
1 parent 0962144 commit b47049f
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -24,7 +24,9 @@ public interface SchemaManagementTool extends Service {
SchemaDropper getSchemaDropper(Map<String,Object> options);
SchemaMigrator getSchemaMigrator(Map<String,Object> options);
SchemaValidator getSchemaValidator(Map<String,Object> options);
SchemaTruncator getSchemaTruncator(Map<String,Object> options);
default SchemaTruncator getSchemaTruncator(Map<String,Object> options) {
throw new UnsupportedOperationException("Schema truncator is not supported by this schema management tool.");
}

/**
* This allows to set an alternative implementation for the Database
Expand All @@ -41,9 +43,11 @@ public interface SchemaManagementTool extends Service {
* Resolves the {@linkplain GenerationTarget targets} to which to
* send the DDL commands based on configuration
*/
GenerationTarget[] buildGenerationTargets(
default GenerationTarget[] buildGenerationTargets(
TargetDescriptor targetDescriptor,
JdbcContext jdbcContext,
Map<String, Object> options,
boolean needsAutoCommit);
boolean needsAutoCommit) {
throw new UnsupportedOperationException("Building generation targets is not supported by this schema management tool.");
}
}

0 comments on commit b47049f

Please sign in to comment.