While using android Room i'm having the following entity:
@Entity
public class Call implements Parcelable {
@PrimaryKey(autoGenerate = true)
private long id;
private String filePath;
private long durationInMillis;
private String phoneNumber;
private int isStarred;
private int isIncoming;
private long timestampCreated;
}
All works great. But now I want my pojo (Call.class) to extends an Abstract class as following:
@Entity
public class Call extends BaseViewTypeData implements Parcelable {
....
....
}
And i'm getting the following error:
Error:Cannot figure out how to save this field into database. You can
consider adding a type converter for it.
Error:Cannot find getter for field.
Error:Cannot find setter for field.
Error:Cannot figure out how to read this field from a cursor.
Error:Cannot find getter for field.
Error:Cannot find setter for field.
The parent (BaseViewTypeData.class) is a simple class to handle multiple view types in a recycler views.
public abstract class BaseViewTypeData extends BaseObservable {
public static final int VIEW_TYPE_CALL = 0;
public static final int VIEW_TYPE_SETTINGS_HEADER = 1;
public static final int VIEW_TYPE_SETTINGS_TITLE_SUBTITLE = 2;
public static final int VIEW_TYPE_SETTINGS_TITLE_SUBTITLE_SWITCH = 3;
public static final int VIEW_TYPE_SETTINGS_DIVIDER = 4;
public static final int VIEW_TYPE_SETTINGS_TITLE_SWITCH = 5;
public static final int VIEW_TYPE_CALL_LOG_DATA = 6;
public static final int VIEW_TYPE_CHECKBOX_TITLE_SUBTITLE = 7;
@Ignore
public abstract int getViewType();
}