简体   繁体   English

如何删除所有没有 SQL 的行

[英]how delete all rows with no SQL

Is the any other way to delete all rows of a database table without writing an SQL delete statement?是否有其他方法可以在不编写 SQL 删除语句的情况下删除数据库表的所有行?

List<Item> items = Ebean.find(Item.class).findList();
Ebean.delete(items);

Is there anything like有没有像

Ebean.deleteAll(Item.class)

in Ebean API?在 Ebean API 中?

Indeed it exists, check this out确实存在, 看看这个

Delete all the beans from a Collection.从集合中删除所有 bean。

public static int delete(Collection<?> c)
                  throws javax.persistence.OptimisticLockException

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM