HHH-15962 Provide simple default impl for new members of `SchemaManagementTool` interface

- make both `getSchemaTruncator/buildGenerationTargets` as default methods throwing `UnsupportedOperationException`
This commit is contained in:
marko-bekhta 2023-01-02 11:08:05 +01:00 committed by Christian Beikov
parent 0962144583
commit b47049f892
1 changed files with 7 additions and 3 deletions

View File

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