I used the ormlite to cache sqlite database with Robospice
. The data after caching look like:
table cacheentry (generated by robospice)
rowid cachekey resultclass resultIntegerId timestamp
-------------------------------------------------------------------------------
1 113 com.sq.src.EventResult 3 1381938044268
table EventResult
id data timestamp
-------------------------
1 121 1381938211268
2 122 1381938444278
3 123 1481938785422
When time is expired, robospice will request and add new row data to EventResult
.
The problem is I want to clear only old data (clear rows id 1, 2 and keep row id 3) from EventResult
which this one:
getSpiceManager().removeDataFromCache(EventResult.class,113);
But it cleared only cache key row from cacheentry
table.
And this one cleard all data from all tables.
getSpiceManager().removeAllDataFromCache();
Could you please tell me how to control clear only old data and keep newest one in table with robospice? Thanks in advance.
Update: The EventResult
has been referenced by many other tables, and I have to clear all reference rows from them.