#1782 - ENH: Add truncate(Class<?>... types) and truncate(String... tables)

Remove truncateTableBefore and truncateTableAfter for now
This commit is contained in:
rob bygrave
2019-08-10 21:44:48 +12:00
parent bb7df71391
commit fea840c859
5 changed files with 7 additions and 29 deletions
@@ -653,11 +653,9 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public void truncate(String... tables) {
try (Connection connection = getDataSource().getConnection()) {
executeSql(connection, databasePlatform.truncateStatementBefore());
for (String table : tables) {
executeSql(connection, databasePlatform.truncateStatement(table));
}
executeSql(connection, databasePlatform.truncateStatementAfter());
connection.commit();
} catch(SQLException e) {
throw new PersistenceException("Error executing truncate", e);