I'm using rushorm for sqlite object serializing and storage. It work pretty cool so far. The problem is that I wan't to store following Request
object:
public class Request extends RushObject {
private String url;
private RequestParamsStorable params;
public Request() {}
public Request(String aUrl, RequestParamsStorable aParams)
{
this.url = aUrl;
this.params = aParams;
}
public String getUrl()
{
return this.url;
}
public RequestParams getParams()
{
return this.params;
}
}
As you can see I need to store RequestParams object. In order to store it, as I obviously cannot make it to extend RushObject
I made a subclass and made it to implement Rush as per docs instructions:
public class RequestParamsStorable extends RequestParams implements Rush {
public RequestParamsStorable() {}
@Override
public void save() { RushCore.getInstance().save(this); }
@Override
public void save(RushCallback callback) { RushCore.getInstance().save(this, callback); }
@Override
public void delete() { RushCore.getInstance().delete(this); }
@Override
public void delete(RushCallback callback) { RushCore.getInstance().delete(this, callback); }
@Override
public String getId() { return RushCore.getInstance().getId(this); }
}
It didn't throw any errors and calling save()
on Request
object went smoothly. When I ask for stored objects like that:
List<Request> remainingsInDB = new RushSearch().find(Request.class);
I indeed receive stored Request
objects, with proper url
, however RequestParamsStorable
is empty(""). I checked and when I save them, they definetely had values, and are not empty.
So the question is where I'm wrong?
Regards,