mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1782 - ENH: Add truncate(Class<?>... types) and truncate(String... tables)
Remove truncateTableBefore and truncateTableAfter for now
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user