1 16 package com.ibatis.sqlmap.engine.scope; 17 18 import com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap; 19 import com.ibatis.sqlmap.engine.mapping.result.ResultMap; 20 import com.ibatis.sqlmap.engine.mapping.sql.Sql; 21 import com.ibatis.sqlmap.engine.mapping.statement.MappedStatement; 22 23 import java.sql.ResultSet ; 24 import java.util.Map ; 25 import java.util.HashMap ; 26 27 30 public class RequestScope extends BaseScope { 31 32 33 private SessionScope session; 35 private ErrorContext errorContext; 36 private MappedStatement statement; 37 private ParameterMap parameterMap; 38 private ResultMap resultMap; 39 private Sql sql; 40 41 private ParameterMap dynamicParameterMap; 43 private String dynamicSql; 44 45 private ResultSet resultSet; 47 private Map uniqueKeys; 48 private boolean rowDataFound; 49 52 public RequestScope() { 53 errorContext = new ErrorContext(); 54 reset(); 55 } 56 57 62 public ErrorContext getErrorContext() { 63 return errorContext; 64 } 65 66 71 public SessionScope getSession() { 72 return session; 73 } 74 75 80 public void setSession(SessionScope session) { 81 this.session = session; 82 } 83 84 89 public MappedStatement getStatement() { 90 return statement; 91 } 92 93 98 public void setStatement(MappedStatement statement) { 99 this.statement = statement; 100 } 101 102 107 public ParameterMap getParameterMap() { 108 return parameterMap; 109 } 110 111 115 public void setParameterMap(ParameterMap parameterMap) { 116 this.parameterMap = parameterMap; 117 } 118 119 124 public ResultMap getResultMap() { 125 return resultMap; 126 } 127 128 133 public void setResultMap(ResultMap resultMap) { 134 this.resultMap = resultMap; 135 } 136 137 142 public Sql getSql() { 143 return sql; 144 } 145 146 151 public void setSql(Sql sql) { 152 this.sql = sql; 153 } 154 155 160 public ParameterMap getDynamicParameterMap() { 161 return dynamicParameterMap; 162 } 163 164 169 public void setDynamicParameterMap(ParameterMap dynamicParameterMap) { 170 this.dynamicParameterMap = dynamicParameterMap; 171 } 172 173 178 public String getDynamicSql() { 179 return dynamicSql; 180 } 181 182 186 public void setDynamicSql(String dynamicSql) { 187 this.dynamicSql = dynamicSql; 188 } 189 190 public ResultSet getResultSet() { 191 return resultSet; 192 } 193 194 public void setResultSet(ResultSet resultSet) { 195 this.resultSet = resultSet; 196 } 197 198 public Map getUniqueKeys(ResultMap map) { 199 if (uniqueKeys == null) { 200 return null; 201 } 202 return (Map)uniqueKeys.get(map); 203 } 204 205 public void setUniqueKeys(ResultMap map, Map keys) { 206 if (uniqueKeys == null) { 207 uniqueKeys = new HashMap (); 208 } 209 this.uniqueKeys.put(map, keys); 210 } 211 212 public boolean isRowDataFound() { 213 return rowDataFound; 214 } 215 216 public void setRowDataFound(boolean rowDataFound) { 217 this.rowDataFound = rowDataFound; 218 } 219 220 public void reset() { 221 super.reset(); 222 errorContext.reset(); 223 session = null; 224 statement = null; 225 parameterMap = null; 226 resultMap = null; 227 sql = null; 228 dynamicParameterMap = null; 229 dynamicSql = null; 230 resultSet = null; 231 uniqueKeys = null; 232 rowDataFound = true; 233 } 234 235 } 236 | Popular Tags |