public class DIHCacheSupport extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CACHE_DELETE_PRIOR_DATA
If the cache supports persistent data, set to "true" to delete any prior
persisted data before running the entity.
|
static String |
CACHE_FOREIGN_KEY
Specify the Foreign Key from the parent entity to join on.
|
static String |
CACHE_IMPL
Specify the class for the cache implementation
|
static String |
CACHE_PRIMARY_KEY
Specify the Primary Key field from this Entity to map the input records
with
|
static String |
CACHE_READ_ONLY
If true, a pre-existing cache is re-opened for read-only access.
|
Constructor and Description |
---|
DIHCacheSupport(Context context,
String cacheImplName) |
Modifier and Type | Method and Description |
---|---|
void |
destroyAll() |
Map<String,Object> |
getCacheData(Context context,
String query,
Iterator<Map<String,Object>> rowIterator) |
protected Map<String,Object> |
getFromRowCacheTransformed() |
protected Map<String,Object> |
getIdCacheData(Context context,
String query,
Iterator<Map<String,Object>> rowIterator)
If the where clause is present the cache is sql Vs Map of key Vs List of
Rows.
|
protected Map<String,Object> |
getSimpleCacheData(Context context,
String query,
Iterator<Map<String,Object>> rowIterator)
If where clause is not present the cache is a Map of query vs List of Rows.
|
void |
initNewParent(Context context) |
void |
populateCache(String query,
Iterator<Map<String,Object>> rowIterator)
Get all the rows from the datasource for the given query and cache them
|
public static final String CACHE_IMPL
Specify the class for the cache implementation
public static final String CACHE_DELETE_PRIOR_DATA
If the cache supports persistent data, set to "true" to delete any prior persisted data before running the entity.
public static final String CACHE_FOREIGN_KEY
Specify the Foreign Key from the parent entity to join on. Use if the cache is on a child entity.
public static final String CACHE_PRIMARY_KEY
Specify the Primary Key field from this Entity to map the input records with
public static final String CACHE_READ_ONLY
If true, a pre-existing cache is re-opened for read-only access.
public void initNewParent(Context context)
public void destroyAll()
public void populateCache(String query, Iterator<Map<String,Object>> rowIterator)
Get all the rows from the datasource for the given query and cache them
public Map<String,Object> getCacheData(Context context, String query, Iterator<Map<String,Object>> rowIterator)
protected Map<String,Object> getIdCacheData(Context context, String query, Iterator<Map<String,Object>> rowIterator)
query
- the query string for which cached data is to be returnedprotected Map<String,Object> getSimpleCacheData(Context context, String query, Iterator<Map<String,Object>> rowIterator)
query
- string for which cached row is to be returned