2015-04-23 50 views
0

我使用糖ORM和工作,我要删除所有,我使用的表,但不工作,不显示在日志文件中的任何错误:批量操作不会对糖ORM

这里是我的MODELE:

private String name; 
private String lastName; 
private String imgSoc; 
private Boolean follow; 
private String adresse; 
private String site; 
private int numOffres; 

public Society(String name, String lastName, 
     String imgSoc, Boolean follow, String adresse, String site, 
     int numOffres) { 


    this.name = name; 
    this.lastName = lastName; 
    this.imgSoc = imgSoc; 
    this.follow = follow; 
    this.adresse = adresse; 
    this.site = site; 
    this.numOffres = numOffres; 
} 

和COMMANDE:

Society.deleteAll(Society.class); 
+0

你可以包括你的模型'class'一部分?你给我的内部,但重要的是看到整个类的声明。 – huu

回答

0

要进行批量删除,你必须实例化类,并选择该记录删除。如果你想删除所有,它看起来是这样的:

List<Society> items = Society.listAll(Society.class); 
Society.deleteAll(Society.class); 

原始documenation:http://satyan.github.io/sugar/getting-started.html