Database objects like Schema already implement drop() method to delete them. To simplify usage, we should let the DatabaseObject interface extend AutoClosable, so that you can use them in try-with-resources blocks. Then they are automatically deleted without explicitly dropping them.
Implementation could be done with minimal effort by adding void close() to DatabaseObject with a default implementation that just calls drop().
Database objects like
Schema
already implementdrop()
method to delete them. To simplify usage, we should let theDatabaseObject
interface extendAutoClosable
, so that you can use them in try-with-resources blocks. Then they are automatically deleted without explicitly dropping them.Implementation could be done with minimal effort by adding
void close()
toDatabaseObject
with a default implementation that just callsdrop()
.