android - Room database architecture entity extends error -
while using android room i'm having 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. want pojo (call.class) extends abstract class following:
@entity public class call extends baseviewtypedata implements parcelable { .... .... }
and i'm getting following error:
error:cannot figure out how save field database. can consider adding type converter it. error:cannot find getter field. error:cannot find setter field. error:cannot figure out how read field cursor. error:cannot find getter field. error:cannot find setter field.
the parent (baseviewtypedata.class) simple class handle multiple view types in 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(); }
thanks help!
the parent (baseviewtypedata.class) simple class handle multiple view types in recycler views.
i suspect problem not baseviewtypedata
, baseobservable
, room not know how deal the baseobservable
fields.
in general, having entity inherit classes not control unlikely work.
Comments
Post a Comment