1 16 package com.ibatis.sqlmap.engine.exchange; 17 18 import com.ibatis.sqlmap.engine.cache.CacheKey; 19 import com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap; 20 import com.ibatis.sqlmap.engine.scope.RequestScope; 21 22 25 public abstract class BaseDataExchange implements DataExchange { 26 27 private DataExchangeFactory dataExchangeFactory; 28 29 protected BaseDataExchange(DataExchangeFactory dataExchangeFactory) { 30 this.dataExchangeFactory = dataExchangeFactory; 31 } 32 33 public CacheKey getCacheKey(RequestScope request, ParameterMap parameterMap, Object parameterObject) { 34 CacheKey key = new CacheKey(); 35 Object [] data = getData(request, parameterMap, parameterObject); 36 for (int i = 0; i < data.length; i++) { 37 if (data[i] != null) { 38 key.update(data[i]); 39 } 40 } 41 return key; 42 } 43 44 48 public DataExchangeFactory getDataExchangeFactory() { 49 return dataExchangeFactory; 50 } 51 52 } 53 | Popular Tags |