我是SugarORM的新手,希望在我的应用程序中使用这个库。在设置完库的元标签之后,我必须为所有类扩展SugarRecord。为此,我创建了一个名为Product的新类如下所示:
@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> {
我使用这个文档。
<ProductModel>
中的ProductModel
是一个类结构吗? - user4790312