public class BaseObjectPersister<T,ID> extends
| Constructor and Description |
|---|
BaseObjectPersister(android.app.Application application,
DatabaseHelper databaseHelper,
java.lang.Class<T> modelObjectType) |
BaseObjectPersister(android.app.Application application,
DatabaseHelper databaseHelper,
java.lang.Class<T> modelObjectType,
android.net.Uri notificationUri) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.Object> |
getAllCacheKeys() |
long |
getCreationDateInCache(java.lang.Object cacheKey) |
boolean |
isDataInCache(java.lang.Object cacheKey,
long maxTimeInCache) |
java.util.List<T> |
loadAllDataFromCache() |
T |
loadDataFromCache(java.lang.Object cacheKey,
long maxTimeInCache) |
void |
removeAllDataFromCache()
We try to delete only the cache entry
which corresponds to the handled class, not to drop the entire cache table.
|
boolean |
removeDataFromCache(java.lang.Object cacheKey) |
protected <E> void |
saveAllForeignObjectsToCache(E data)
During this operation, we must save a new POJO (parent) into the database.
|
T |
saveDataToCacheAndReturnData(T data,
java.lang.Object cacheKey) |
public BaseObjectPersister(android.app.Application application,
DatabaseHelper databaseHelper,
java.lang.Class<T> modelObjectType)
application - the android context needed to access android file system or databases to store.public BaseObjectPersister(android.app.Application application,
DatabaseHelper databaseHelper,
java.lang.Class<T> modelObjectType,
android.net.Uri notificationUri)
application - the android context needed to access android file system or databases to store.public T loadDataFromCache(java.lang.Object cacheKey, long maxTimeInCache) throws CacheLoadingException
CacheLoadingExceptionpublic T saveDataToCacheAndReturnData(T data, java.lang.Object cacheKey) throws CacheSavingException
CacheSavingExceptionpublic boolean isDataInCache(java.lang.Object cacheKey,
long maxTimeInCache)
public long getCreationDateInCache(java.lang.Object cacheKey)
throws CacheLoadingException
CacheLoadingExceptionprotected <E> void saveAllForeignObjectsToCache(E data)
throws java.sql.SQLException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
data - the parent POJO to save in the database.java.sql.SQLExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionpublic boolean removeDataFromCache(java.lang.Object cacheKey)
public void removeAllDataFromCache()
public java.util.List<T> loadAllDataFromCache() throws CacheLoadingException
CacheLoadingExceptionpublic java.util.List<java.lang.Object> getAllCacheKeys()