我是 SugarORM 的新手,我想在我的应用程序中使用这个库。设置此库元标记后,我必须为所有类扩展 SugarRecord,对于此操作,我将创建新类作为产品作为此示例
@Table
public class ProductTable {
private String id;
private String count;
public ProductTable() {
}
public ProductTable(String id, String count) {
this.id = id;
this.count = count;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
}
对于扩展 SugarRecord,我希望有这样的示例:
public class ProductModel extends SugarRecord<ProductModel> {
String title;
String edition;
public ProductModel(){
}
public ProductModel(String title, String edition){
this.title = title;
this.edition = edition;
}
}
但我收到此错误:
Error:(9, 46) java: type com.orm.SugarRecord does not take parameters
对于这一行:
public class ProductModel extends SugarRecord<ProductModel> {
我正在使用此文档