Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Getting started with Sugar ORM

i'm newbie in SugarORM and i want to use this library into my application. after set this library meta-tags i must be Extend SugarRecord for all the classes, for this action i'm create new class as Product as this sample

@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;
    }
}

and for Extend SugarRecord i'm want to have class as this sample:

public class ProductModel extends SugarRecord<ProductModel> {
    String title;
    String edition;

    public ProductModel(){
    }

    public ProductModel(String title, String edition){
        this.title = title;
        this.edition = edition;
    }
}

but i get this error:

Error:(9, 46) java: type com.orm.SugarRecord does not take parameters

for this line:

public class ProductModel extends SugarRecord<ProductModel> {

i'm using this Document


1 Answers

You don't have to extend SugarRecord<ProductModel> anymore, just SugarRecord will do it.

like image 194
rafaelc Avatar answered Jul 26 '26 08:07

rafaelc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!