You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi ,
please help me.
In my recent projects the data store in local database is not always the same with data from server.
My basemodel.class looks like this:
public class BaseModel{
private static final String SUCCESS_CODE = "00";
private static final String INVALID_COOKIE = "10";
public static final String JSON_ROOT_NAME = "data";
@SerializedName("statusCode")
public String statusCode;
@SerializedName("statusMsg")
public String statusMsg;
}
then my listmodel.class looks like this:
public abstract class ListModel extends BaseModel {
@SerializedName(JSON_ROOT_NAME)
public ArrayList modelList;
}
with retrofit and gson it works fine, but if I want to store the modelList into database without status info, how can I do? For now I can get the List , but realm requires "extends RealmObject", any idea?
The text was updated successfully, but these errors were encountered:
Hi @machinezhou
Currently Realm doesn't support subclassing (except from RealmObject), so your only choice is to move the fields from BaseMode to your ListModel.
However it is definitely something we want to support going forward, but there are a few hurdles in the core database we have to tackle first. You can follow progress on this here: #761
ok then, looking forward. Thanks for your effort.
2015年3月16日 上午4:41于 "Christian Melchior" [email protected]写道:
Hi @machinezhouhttps://github.com/machinezhou
Currently Realm doesn't support subclassing (except from RealmObject), so
your only choice is to move the fields from BaseMode to your ListModel.
However it is definitely something we want to support going forward, but
there are a few hurdles in the core database we have to tackle first. You
can follow progress on this here: #761 #761
—
Reply to this email directly or view it on GitHub #963 (comment).
hi ,
please help me.
In my recent projects the data store in local database is not always the same with data from server.
My basemodel.class looks like this:
public class BaseModel{
private static final String SUCCESS_CODE = "00";
private static final String INVALID_COOKIE = "10";
public static final String JSON_ROOT_NAME = "data";
@SerializedName("statusCode")
public String statusCode;
@SerializedName("statusMsg")
public String statusMsg;
}
then my listmodel.class looks like this:
public abstract class ListModel extends BaseModel {
@SerializedName(JSON_ROOT_NAME)
public ArrayList modelList;
}
with retrofit and gson it works fine, but if I want to store the modelList into database without status info, how can I do? For now I can get the List , but realm requires "extends RealmObject", any idea?
The text was updated successfully, but these errors were encountered: