/** * Flush a single cache by ID * * @param id - the ID */ public void flushDataCache(String id) { CacheModel model = getCacheModel(id); if (model != null) { model.flush(); } }
private void wireUpCacheModels() { // Wire Up Cache Models Iterator cacheNames = client.getDelegate().getCacheModelNames(); while (cacheNames.hasNext()) { String cacheName = (String) cacheNames.next(); CacheModel cacheModel = client.getDelegate().getCacheModel(cacheName); Iterator statementNames = cacheModel.getFlushTriggerStatementNames(); while (statementNames.hasNext()) { String statementName = (String) statementNames.next(); MappedStatement statement = client.getDelegate().getMappedStatement(statementName); if (statement != null) { statement.addExecuteListener(cacheModel); } else { throw new RuntimeException("Could not find statement named '" + statementName + "' for use as a flush trigger for the cache model named '" + cacheName + "'."); } } } }
private void wireUpCacheModels() { // Wire Up Cache Models Iterator cacheNames = client.getDelegate().getCacheModelNames(); while (cacheNames.hasNext()) { String cacheName = (String) cacheNames.next(); CacheModel cacheModel = client.getDelegate().getCacheModel(cacheName); Iterator statementNames = cacheModel.getFlushTriggerStatementNames(); while (statementNames.hasNext()) { String statementName = (String) statementNames.next(); MappedStatement statement = client.getDelegate().getMappedStatement(statementName); if (statement != null) { statement.addExecuteListener(cacheModel); } else { throw new RuntimeException("Could not find statement named '" + statementName + "' for use as a flush trigger for the cache model named '" + cacheName + "'."); } } } }
/** * Flush a single cache by ID * * @param id - the ID */ public void flushDataCache(String id) { CacheModel model = getCacheModel(id); if (model != null) { model.flush(); } }
statement.setSqlMapClient(client); if (cacheModelName != null && cacheModelName.length() > 0 && client.getDelegate().isCacheModelsEnabled()) { CacheModel cacheModel = client.getDelegate().getCacheModel(cacheModelName); mappedStatement = new CachingStatement(statement, cacheModel); } else {
statement.setSqlMapClient(client); if (cacheModelName != null && cacheModelName.length() > 0 && client.getDelegate().isCacheModelsEnabled()) { CacheModel cacheModel = client.getDelegate().getCacheModel(cacheModelName); mappedStatement = new CachingStatement(statement, cacheModel); } else {