AutoIncrement primary key in subclass of Room model

By | July 12, 2018

I have a class Model

public abstract class Model {
    public String id;

and sub-class FooModel

public FooModel extends Model {
    String name;

I’d like to mark id as autoincrement but only in the child FooModel using @PrimaryKey(autoGenerate = true)

How can I go about this?


Leave a Reply

Your email address will not be published. Required fields are marked *