Clover coverage report - JFox Service-Oriented Application Framework - 1.0-RC2 Coverage timestamp: 星期四 十二月 15 2005 11:58:01 CST FRAMES NO FRAMES |
file stats: | LOC: | 1,539 |  | Methods: | 85
| NCLOC: | 1,104 |  | Classes: | 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
Source file | Conditionals | Statements | Methods | TOTAL
MrPersisterServiceImpl.java | - | 1.6% | 4.7% | 2% |

1 |  |
     /*
2 |  |
      * Created on 2005-9-7
3 |  |
      *
4 |  |
      * TODO To change the template for this generated file go to
5 |  |
      * Window - Preferences - Java - Code Style - Code Templates
6 |  |
      */
7 |  |
     package org.huihoo.jfox.soaf.services.persistence;
8 |  |
9 |  |
     import java.sql.Connection;
10 |  |
     import java.sql.PreparedStatement;
11 |  |
     import java.sql.ResultSet;
12 |  |
     import java.sql.SQLException;
13 |  |
     import java.sql.Statement;
14 |  |
     import java.util.Collection;
15 |  |
     import java.util.List;
16 |  |
17 |  |
     import javax.sql.DataSource;
18 |  |
19 |  |
     import org.huihoo.jfox.soaf.exception.DAOException;
20 |  |
21 |  |
     import com.jenkov.mrpersister.PersistenceManager;
22 |  |
     import com.jenkov.mrpersister.itf.IGenericDao;
23 |  |
     import com.jenkov.mrpersister.itf.IReadFilter;
24 |  |
     import com.jenkov.mrpersister.itf.PersistenceException;
25 |  |
     import com.jenkov.mrpersister.util.JdbcUtil;
26 |  |
27 |  |
     /**
28 |  |
      * @author peter.cheng
29 |  |
      *
30 |  |
      * TODO To change the template for this generated type comment go to Window -
31 |  |
      * Preferences - Java - Code Style - Code Templates
32 |  |
      */
33 |  |
     public class MrPersisterServiceImpl implements MrPersisterService {
34 |  |
35 |  |
         private PersistenceManager pm;
36 |  |
37 |  |
         private DataSource dataSource;
38 |  |
39 |  |
         private Connection conn;
40 |  |
41 |  |
         /**
42 |  |
          *
43 |  |
          */
44 | 1 |
         public MrPersisterServiceImpl() {
45 | 1 |
             this.pm = new PersistenceManager();
46 |  |
         }
47 |  |
48 |  |
         /**
49 |  |
          * @param dataSource
50 |  |
          *            The dataSource to set.
51 |  |
          */
52 | 82 |
         public void setDataSource(DataSource dataSource) {
53 | 82 |
             this.dataSource = dataSource;
54 |  |
         }
55 |  |
56 | 2 |
         private IGenericDao createDao() throws SQLException {
57 | 2 |
             return pm.getGenericDaoFactory().createDao(dataSource.getConnection());
58 |  |
         }
59 |  |
60 | 0 |
         private IGenericDao createDao(Connection conn) throws SQLException {
61 | 0 |
             return pm.getGenericDaoFactory().createDao(conn);
62 |  |
         }
63 |  |
64 |  |
         /**
65 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#delete(java.sql.Connection,
66 |  |
          *      java.lang.Object)
67 |  |
          */
68 | 0 |
         public int delete(Connection conn, Object object)
69 |  |
                 throws PersistenceException, DAOException {
70 | 0 |
             int rows = 0;
71 | 0 |
             IGenericDao dao = null;
72 | 0 |
             try {
73 | 0 |
                 dao = createDao(conn);
74 | 0 |
                 rows = dao.delete(object);
75 |  |
             } catch (Exception e) {
76 | 0 |
                 throw new DAOException(e);
77 |  |
             }
78 | 0 |
             return rows;
79 |  |
         }
80 |  |
81 |  |
         /**
82 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#delete(java.lang.Object)
83 |  |
          */
84 | 0 |
         public int delete(Object object) throws PersistenceException, DAOException {
85 | 0 |
             int rows = 0;
86 | 0 |
             IGenericDao dao = null;
87 | 0 |
             try {
88 | 0 |
                 dao = createDao();
89 | 0 |
                 rows = dao.delete(object);
90 |  |
             } catch (Exception e) {
91 | 0 |
                 throw new DAOException(e);
92 |  |
             } finally {
93 | 0 |
                 JdbcUtil.close(dao);
94 |  |
             }
95 | 0 |
             return rows;
96 |  |
         }
97 |  |
98 |  |
         /**
99 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#delete(java.lang.Object,
100 |  |
          *      java.lang.Object)
101 |  |
          */
102 | 0 |
         public int delete(Object objectMappingKey, Object object)
103 |  |
                 throws PersistenceException, DAOException {
104 | 0 |
             int rows = 0;
105 | 0 |
             IGenericDao dao = null;
106 | 0 |
             try {
107 | 0 |
                 dao = createDao();
108 | 0 |
                 rows = dao.delete(objectMappingKey, object);
109 |  |
             } catch (Exception e) {
110 | 0 |
                 throw new DAOException(e);
111 |  |
             } finally {
112 | 0 |
                 JdbcUtil.close(dao);
113 |  |
             }
114 | 0 |
             return rows;
115 |  |
         }
116 |  |
117 |  |
         /**
118 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#delete(java.sql.Connection,
119 |  |
          *      java.lang.Object, java.lang.Object)
120 |  |
          */
121 | 0 |
         public int delete(Connection conn, Object objectMappingKey, Object object)
122 |  |
                 throws PersistenceException, DAOException {
123 | 0 |
             int rows = 0;
124 | 0 |
             IGenericDao dao = null;
125 | 0 |
             try {
126 | 0 |
                 dao = createDao(conn);
127 | 0 |
                 rows = dao.delete(objectMappingKey, object);
128 |  |
             } catch (Exception e) {
129 | 0 |
                 throw new DAOException(e);
130 |  |
             }
131 | 0 |
             return rows;
132 |  |
         }
133 |  |
134 |  |
         /**
135 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteBatch(java.util.Collection)
136 |  |
          */
137 | 0 |
         public int[] deleteBatch(Collection objects) throws PersistenceException,
138 |  |
                 DAOException {
139 | 0 |
             int[] rows;
140 | 0 |
             IGenericDao dao = null;
141 | 0 |
             try {
142 | 0 |
                 dao = createDao();
143 | 0 |
                 rows = dao.deleteBatch(objects);
144 |  |
             } catch (Exception e) {
145 | 0 |
                 throw new DAOException(e);
146 |  |
             } finally {
147 | 0 |
                 JdbcUtil.close(dao);
148 |  |
             }
149 | 0 |
             return rows;
150 |  |
         }
151 |  |
152 |  |
         /**
153 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteBatch(java.sql.Connection,
154 |  |
          *      java.util.Collection)
155 |  |
          */
156 | 0 |
         public int[] deleteBatch(Connection conn, Collection objects)
157 |  |
                 throws PersistenceException, DAOException {
158 | 0 |
             int[] rows;
159 | 0 |
             IGenericDao dao = null;
160 | 0 |
             try {
161 | 0 |
                 dao = createDao(conn);
162 | 0 |
                 rows = dao.deleteBatch(objects);
163 |  |
             } catch (Exception e) {
164 | 0 |
                 throw new DAOException(e);
165 |  |
             }
166 | 0 |
             return rows;
167 |  |
         }
168 |  |
169 |  |
         /**
170 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteBatch(java.sql.Connection,
171 |  |
          *      java.lang.Object, java.util.Collection)
172 |  |
          */
173 | 0 |
         public int[] deleteBatch(Connection conn, Object objectMappingKey,
174 |  |
                 Collection objects) throws PersistenceException, DAOException {
175 | 0 |
             int[] rows;
176 | 0 |
             IGenericDao dao = null;
177 | 0 |
             try {
178 | 0 |
                 dao = createDao(conn);
179 | 0 |
                 rows = dao.deleteBatch(objectMappingKey, objects);
180 |  |
             } catch (Exception e) {
181 | 0 |
                 throw new DAOException(e);
182 |  |
             }
183 | 0 |
             return rows;
184 |  |
         }
185 |  |
186 |  |
         /**
187 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteBatch(java.lang.Object,
188 |  |
          *      java.util.Collection)
189 |  |
          */
190 | 0 |
         public int[] deleteBatch(Object objectMappingKey, Collection objects)
191 |  |
                 throws PersistenceException, DAOException {
192 | 0 |
             int[] rows;
193 | 0 |
             IGenericDao dao = null;
194 | 0 |
             try {
195 | 0 |
                 dao = createDao();
196 | 0 |
                 rows = dao.deleteBatch(objectMappingKey, objects);
197 |  |
             } catch (Exception e) {
198 | 0 |
                 throw new DAOException(e);
199 |  |
             } finally {
200 | 0 |
                 JdbcUtil.close(dao);
201 |  |
             }
202 | 0 |
             return rows;
203 |  |
         }
204 |  |
205 |  |
         /**
206 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteByPrimaryKey(java.sql.Connection,
207 |  |
          *      java.lang.Object, java.lang.Object)
208 |  |
          */
209 | 0 |
         public int deleteByPrimaryKey(Connection conn, Object objectMappingKey,
210 |  |
                 Object primaryKey) throws PersistenceException, DAOException {
211 | 0 |
             int rows = 0;
212 | 0 |
             IGenericDao dao = null;
213 | 0 |
             try {
214 | 0 |
                 dao = createDao(conn);
215 | 0 |
                 rows = dao.deleteByPrimaryKey(objectMappingKey, primaryKey);
216 |  |
             } catch (Exception e) {
217 | 0 |
                 throw new DAOException(e);
218 |  |
             }
219 | 0 |
             return rows;
220 |  |
         }
221 |  |
222 |  |
         /**
223 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteByPrimaryKey(java.lang.Object,
224 |  |
          *      java.lang.Object)
225 |  |
          */
226 | 0 |
         public int deleteByPrimaryKey(Object objectMappingKey, Object primaryKey)
227 |  |
                 throws PersistenceException, DAOException {
228 | 0 |
             int rows = 0;
229 | 0 |
             IGenericDao dao = null;
230 | 0 |
             try {
231 | 0 |
                 dao = createDao();
232 | 0 |
                 rows = dao.deleteByPrimaryKey(objectMappingKey, primaryKey);
233 |  |
             } catch (Exception e) {
234 | 0 |
                 throw new DAOException(e);
235 |  |
             } finally {
236 | 0 |
                 JdbcUtil.close(dao);
237 |  |
             }
238 | 0 |
             return rows;
239 |  |
         }
240 |  |
241 |  |
         /**
242 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteBatchByPrimaryKeys(java.lang.Object,
243 |  |
          *      java.util.Collection)
244 |  |
          */
245 | 0 |
         public int[] deleteBatchByPrimaryKeys(Object objectMappingKey,
246 |  |
                 Collection primaryKeys) throws PersistenceException, DAOException {
247 | 0 |
             int[] rows;
248 | 0 |
             IGenericDao dao = null;
249 | 0 |
             try {
250 | 0 |
                 dao = createDao();
251 | 0 |
                 rows = dao.deleteBatchByPrimaryKeys(objectMappingKey,
252 |  |
                         primaryKeys);
253 |  |
             } catch (Exception e) {
254 | 0 |
                 throw new DAOException(e);
255 |  |
             } finally {
256 | 0 |
                 JdbcUtil.close(dao);
257 |  |
             }
258 | 0 |
             return rows;
259 |  |
         }
260 |  |
261 |  |
         /**
262 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteBatchByPrimaryKeys(java.sql.Connection,
263 |  |
          *      java.lang.Object, java.util.Collection)
264 |  |
          */
265 | 0 |
         public int[] deleteBatchByPrimaryKeys(Connection conn,
266 |  |
                 Object objectMappingKey, Collection primaryKeys)
267 |  |
                 throws PersistenceException, DAOException {
268 | 0 |
             int[] rows;
269 | 0 |
             IGenericDao dao = null;
270 | 0 |
             try {
271 | 0 |
                 dao = createDao(conn);
272 | 0 |
                 rows = dao.deleteBatchByPrimaryKeys(objectMappingKey,
273 |  |
                         primaryKeys);
274 |  |
             } catch (Exception e) {
275 | 0 |
                 throw new DAOException(e);
276 |  |
             }
277 | 0 |
             return rows;
278 |  |
         }
279 |  |
280 |  |
         /**
281 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#executeUpdate(java.lang.String,
282 |  |
          *      java.util.Collection)
283 |  |
          */
284 | 0 |
         public int executeUpdate(String sql, Collection parameters)
285 |  |
                 throws PersistenceException {
286 | 0 |
             int nums = 0;
287 | 0 |
             IGenericDao dao = null;
288 | 0 |
             try {
289 | 0 |
                 dao = createDao();
290 | 0 |
                 nums = dao.executeUpdate(sql, parameters);
291 |  |
             } catch (Exception e) {
292 | 0 |
                 throw new DAOException(e);
293 |  |
             } finally {
294 | 0 |
                 JdbcUtil.close(dao);
295 |  |
             }
296 | 0 |
             return nums;
297 |  |
         }
298 |  |
299 |  |
         /**
300 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#executeUpdate(java.sql.Connection,
301 |  |
          *      java.lang.String, java.util.Collection)
302 |  |
          */
303 | 0 |
         public int executeUpdate(Connection conn, String sql, Collection parameters)
304 |  |
                 throws PersistenceException, DAOException {
305 | 0 |
             int nums = 0;
306 | 0 |
             IGenericDao dao = null;
307 | 0 |
             try {
308 | 0 |
                 dao = createDao(conn);
309 | 0 |
                 nums = dao.executeUpdate(sql, parameters);
310 |  |
             } catch (Exception e) {
311 | 0 |
                 throw new DAOException(e);
312 |  |
             }
313 | 0 |
             return nums;
314 |  |
         }
315 |  |
316 |  |
         /**
317 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#executeUpdate(java.lang.String,
318 |  |
          *      java.lang.Object[])
319 |  |
          */
320 | 0 |
         public int executeUpdate(String sql, Object[] parameters)
321 |  |
                 throws PersistenceException {
322 | 0 |
             int nums = 0;
323 | 0 |
             IGenericDao dao = null;
324 | 0 |
             try {
325 | 0 |
                 dao = createDao();
326 | 0 |
                 nums = dao.executeUpdate(sql, parameters);
327 |  |
             } catch (Exception e) {
328 | 0 |
                 throw new DAOException(e);
329 |  |
             } finally {
330 | 0 |
                 JdbcUtil.close(dao);
331 |  |
             }
332 | 0 |
             return nums;
333 |  |
         }
334 |  |
335 |  |
         /**
336 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#executeUpdate(java.sql.Connection,
337 |  |
          *      java.lang.String, java.lang.Object[])
338 |  |
          */
339 | 0 |
         public int executeUpdate(Connection conn, String sql, Object[] parameters)
340 |  |
                 throws PersistenceException, DAOException {
341 | 0 |
             int nums = 0;
342 | 0 |
             IGenericDao dao = null;
343 | 0 |
             try {
344 | 0 |
                 dao = createDao(conn);
345 | 0 |
                 nums = dao.executeUpdate(sql, parameters);
346 |  |
             } catch (Exception e) {
347 | 0 |
                 throw new DAOException(e);
348 |  |
             }
349 | 0 |
             return nums;
350 |  |
         }
351 |  |
352 |  |
         /**
353 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#executeUpdate(java.lang.String)
354 |  |
          */
355 | 2 |
         public int executeUpdate(String sql) throws PersistenceException,
356 |  |
                 DAOException {
357 | 2 |
             int nums = 0;
358 | 2 |
             IGenericDao dao = null;
359 | 2 |
             try {
360 | 2 |
                 dao = createDao();
361 | 2 |
                 nums = dao.executeUpdate(sql);
362 |  |
             } catch (Exception e) {
363 | 0 |
                 throw new DAOException(e);
364 |  |
             } finally {
365 | 2 |
                 JdbcUtil.close(dao);
366 |  |
             }
367 | 2 |
             return nums;
368 |  |
         }
369 |  |
370 |  |
         /**
371 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#executeUpdate(java.sql.Connection,
372 |  |
          *      java.lang.String)
373 |  |
          */
374 | 0 |
         public int executeUpdate(Connection conn, String sql)
375 |  |
                 throws PersistenceException, DAOException {
376 | 0 |
             int nums = 0;
377 | 0 |
             IGenericDao dao = null;
378 | 0 |
             try {
379 | 0 |
                 dao = createDao(conn);
380 | 0 |
                 nums = dao.executeUpdate(sql);
381 |  |
             } catch (Exception e) {
382 | 0 |
                 throw new DAOException(e);
383 |  |
             }
384 | 0 |
             return nums;
385 |  |
         }
386 |  |
387 |  |
         /**
388 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insert(java.lang.Object,
389 |  |
          *      java.lang.Object)
390 |  |
          */
391 | 0 |
         public int insert(Object objectMappingKey, Object object)
392 |  |
                 throws PersistenceException {
393 | 0 |
             int nums = 0;
394 | 0 |
             IGenericDao dao = null;
395 | 0 |
             try {
396 | 0 |
                 dao = createDao();
397 | 0 |
                 nums = dao.insert(objectMappingKey, object);
398 |  |
             } catch (Exception e) {
399 | 0 |
                 throw new DAOException(e);
400 |  |
             } finally {
401 | 0 |
                 JdbcUtil.close(dao);
402 |  |
             }
403 | 0 |
             return nums;
404 |  |
         }
405 |  |
406 |  |
         /**
407 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insert(java.sql.Connection,
408 |  |
          *      java.lang.Object, java.lang.Object)
409 |  |
          */
410 | 0 |
         public int insert(Connection conn, Object objectMappingKey, Object object)
411 |  |
                 throws PersistenceException, DAOException {
412 | 0 |
             int nums = 0;
413 | 0 |
             IGenericDao dao = null;
414 | 0 |
             try {
415 | 0 |
                 dao = createDao(conn);
416 | 0 |
                 nums = dao.insert(objectMappingKey, object);
417 |  |
             } catch (Exception e) {
418 | 0 |
                 throw new DAOException(e);
419 |  |
             }
420 | 0 |
             return nums;
421 |  |
         }
422 |  |
423 |  |
         /**
424 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insert(java.lang.Object)
425 |  |
          */
426 | 0 |
         public int insert(Object object) throws PersistenceException {
427 | 0 |
             int nums = 0;
428 | 0 |
             IGenericDao dao = null;
429 | 0 |
             try {
430 | 0 |
                 dao = createDao();
431 | 0 |
                 nums = dao.insert(object);
432 |  |
             } catch (Exception e) {
433 | 0 |
                 throw new DAOException(e);
434 |  |
             } finally {
435 | 0 |
                 JdbcUtil.close(dao);
436 |  |
             }
437 | 0 |
             return nums;
438 |  |
         }
439 |  |
440 |  |
         /**
441 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insert(java.sql.Connection,
442 |  |
          *      java.lang.Object)
443 |  |
          */
444 | 0 |
         public int insert(Connection conn, Object object)
445 |  |
                 throws PersistenceException, DAOException {
446 | 0 |
             int nums = 0;
447 | 0 |
             IGenericDao dao = null;
448 | 0 |
             try {
449 | 0 |
                 dao = createDao(conn);
450 | 0 |
                 nums = dao.insert(object);
451 |  |
             } catch (Exception e) {
452 | 0 |
                 throw new DAOException(e);
453 |  |
             }
454 | 0 |
             return nums;
455 |  |
         }
456 |  |
457 |  |
         /*
458 |  |
          * 8
459 |  |
          *
460 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insertBatch(java.util.Collection)
461 |  |
          */
462 | 0 |
         public int[] insertBatch(Collection objects) throws PersistenceException {
463 | 0 |
             int[] nums;
464 | 0 |
             IGenericDao dao = null;
465 | 0 |
             try {
466 | 0 |
                 dao = createDao();
467 | 0 |
                 nums = dao.insertBatch(objects);
468 |  |
             } catch (Exception e) {
469 | 0 |
                 throw new DAOException(e);
470 |  |
             } finally {
471 | 0 |
                 JdbcUtil.close(dao);
472 |  |
             }
473 | 0 |
             return nums;
474 |  |
         }
475 |  |
476 |  |
         /**
477 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insertBatch(java.lang.Object,
478 |  |
          *      java.util.Collection)
479 |  |
          */
480 | 0 |
         public int[] insertBatch(Object objectMappingKey, Collection objects)
481 |  |
                 throws PersistenceException {
482 | 0 |
             int[] nums;
483 | 0 |
             IGenericDao dao = null;
484 | 0 |
             try {
485 | 0 |
                 dao = createDao();
486 | 0 |
                 nums = dao.insertBatch(objects);
487 |  |
             } catch (Exception e) {
488 | 0 |
                 throw new DAOException(e);
489 |  |
             } finally {
490 | 0 |
                 JdbcUtil.close(dao);
491 |  |
             }
492 | 0 |
             return nums;
493 |  |
         }
494 |  |
495 |  |
         /**
496 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insertBatch(java.sql.Connection,
497 |  |
          *      java.util.Collection)
498 |  |
          */
499 | 0 |
         public int[] insertBatch(Connection conn, Collection objects)
500 |  |
                 throws PersistenceException, DAOException {
501 | 0 |
             int[] nums;
502 | 0 |
             IGenericDao dao = null;
503 | 0 |
             try {
504 | 0 |
                 dao = createDao(conn);
505 | 0 |
                 nums = dao.insertBatch(objects);
506 |  |
             } catch (Exception e) {
507 | 0 |
                 throw new DAOException(e);
508 |  |
             }
509 | 0 |
             return nums;
510 |  |
         }
511 |  |
512 |  |
         /**
513 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
514 |  |
          *      java.sql.PreparedStatement)
515 |  |
          */
516 | 0 |
         public Object read(Object objectMappingKey, PreparedStatement statement)
517 |  |
                 throws PersistenceException {
518 | 0 |
             Object object;
519 | 0 |
             IGenericDao dao = null;
520 | 0 |
             try {
521 | 0 |
                 dao = createDao();
522 | 0 |
                 object = dao.read(objectMappingKey, statement);
523 |  |
             } catch (Exception e) {
524 | 0 |
                 throw new DAOException(e);
525 |  |
             } finally {
526 | 0 |
                 JdbcUtil.close(dao);
527 |  |
             }
528 | 0 |
             return object;
529 |  |
         }
530 |  |
531 |  |
         /**
532 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.sql.Connection,
533 |  |
          *      java.lang.Object, java.sql.PreparedStatement)
534 |  |
          */
535 | 0 |
         public Object read(Connection conn, Object objectMappingKey,
536 |  |
                 PreparedStatement statement) throws PersistenceException,
537 |  |
                 DAOException {
538 | 0 |
             Object object;
539 | 0 |
             IGenericDao dao = null;
540 | 0 |
             try {
541 | 0 |
                 dao = createDao(conn);
542 | 0 |
                 object = dao.read(objectMappingKey, statement);
543 |  |
             } catch (Exception e) {
544 | 0 |
                 throw new DAOException(e);
545 |  |
             }
546 | 0 |
             return object;
547 |  |
         }
548 |  |
549 |  |
         /**
550 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
551 |  |
          *      java.sql.ResultSet)
552 |  |
          */
553 | 0 |
         public Object read(Object objectMappingKey, ResultSet result)
554 |  |
                 throws PersistenceException {
555 | 0 |
             Object object;
556 | 0 |
             IGenericDao dao = null;
557 | 0 |
             try {
558 | 0 |
                 dao = createDao();
559 | 0 |
                 object = dao.read(objectMappingKey, result);
560 |  |
             } catch (Exception e) {
561 | 0 |
                 throw new DAOException(e);
562 |  |
             } finally {
563 | 0 |
                 JdbcUtil.close(dao);
564 |  |
             }
565 | 0 |
             return object;
566 |  |
         }
567 |  |
568 |  |
         /**
569 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.sql.Connection,
570 |  |
          *      java.lang.Object, java.sql.ResultSet)
571 |  |
          */
572 | 0 |
         public Object read(Connection conn, Object objectMappingKey,
573 |  |
                 ResultSet result) throws PersistenceException, DAOException {
574 | 0 |
             Object object;
575 | 0 |
             IGenericDao dao = null;
576 | 0 |
             try {
577 | 0 |
                 dao = createDao(conn);
578 | 0 |
                 object = dao.read(objectMappingKey, result);
579 |  |
             } catch (Exception e) {
580 | 0 |
                 throw new DAOException(e);
581 |  |
             }
582 | 0 |
             return object;
583 |  |
         }
584 |  |
585 |  |
         /**
586 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
587 |  |
          *      java.sql.Statement, java.lang.String)
588 |  |
          */
589 | 0 |
         public Object read(Object objectMappingKey, Statement statement, String sql)
590 |  |
                 throws PersistenceException, DAOException {
591 | 0 |
             Object object;
592 | 0 |
             IGenericDao dao = null;
593 | 0 |
             try {
594 | 0 |
                 dao = createDao();
595 | 0 |
                 object = dao.read(objectMappingKey, statement, sql);
596 |  |
             } catch (Exception e) {
597 | 0 |
                 throw new DAOException(e);
598 |  |
             } finally {
599 | 0 |
                 JdbcUtil.close(dao);
600 |  |
             }
601 | 0 |
             return object;
602 |  |
         }
603 |  |
604 |  |
         /**
605 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.sql.Connection,
606 |  |
          *      java.lang.Object, java.sql.Statement, java.lang.String)
607 |  |
          */
608 | 0 |
         public Object read(Connection conn, Object objectMappingKey,
609 |  |
                 Statement statement, String sql) throws PersistenceException,
610 |  |
                 DAOException {
611 | 0 |
             Object object;
612 | 0 |
             IGenericDao dao = null;
613 | 0 |
             try {
614 | 0 |
                 dao = createDao(conn);
615 | 0 |
                 object = dao.read(objectMappingKey, statement, sql);
616 |  |
             } catch (Exception e) {
617 | 0 |
                 throw new DAOException(e);
618 |  |
             }
619 | 0 |
             return object;
620 |  |
         }
621 |  |
622 |  |
         /**
623 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
624 |  |
          *      java.lang.String, java.util.Collection)
625 |  |
          */
626 | 0 |
         public Object read(Object objectMappingKey, String sql,
627 |  |
                 Collection parameters) throws PersistenceException {
628 | 0 |
             Object object;
629 | 0 |
             IGenericDao dao = null;
630 | 0 |
             try {
631 | 0 |
                 dao = createDao();
632 | 0 |
                 object = dao.read(objectMappingKey, sql, parameters);
633 |  |
             } catch (Exception e) {
634 | 0 |
                 throw new DAOException(e);
635 |  |
             } finally {
636 | 0 |
                 JdbcUtil.close(dao);
637 |  |
             }
638 | 0 |
             return object;
639 |  |
         }
640 |  |
641 |  |
         /**
642 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.sql.Connection,
643 |  |
          *      java.lang.Object, java.lang.String, java.util.Collection)
644 |  |
          */
645 | 0 |
         public Object read(Connection conn, Object objectMappingKey, String sql,
646 |  |
                 Collection parameters) throws PersistenceException, DAOException {
647 | 0 |
             Object object;
648 | 0 |
             IGenericDao dao = null;
649 | 0 |
             try {
650 | 0 |
                 dao = createDao(conn);
651 | 0 |
                 object = dao.read(objectMappingKey, sql, parameters);
652 |  |
             } catch (Exception e) {
653 | 0 |
                 throw new DAOException(e);
654 |  |
             }
655 | 0 |
             return object;
656 |  |
         }
657 |  |
658 |  |
         /**
659 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
660 |  |
          *      java.lang.String, java.lang.Object[])
661 |  |
          */
662 | 0 |
         public Object read(Object objectMappingKey, String sql, Object[] parameters)
663 |  |
                 throws PersistenceException {
664 | 0 |
             Object object;
665 | 0 |
             IGenericDao dao = null;
666 | 0 |
             try {
667 | 0 |
                 dao = createDao();
668 | 0 |
                 object = dao.read(objectMappingKey, sql, parameters);
669 |  |
             } catch (Exception e) {
670 | 0 |
                 throw new DAOException(e);
671 |  |
             } finally {
672 | 0 |
                 JdbcUtil.close(dao);
673 |  |
             }
674 | 0 |
             return object;
675 |  |
         }
676 |  |
677 |  |
         /**
678 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.sql.Connection,
679 |  |
          *      java.lang.Object, java.lang.String, java.lang.Object[])
680 |  |
          */
681 | 0 |
         public Object read(Connection conn, Object objectMappingKey, String sql,
682 |  |
                 Object[] parameters) throws PersistenceException, DAOException {
683 | 0 |
             Object object;
684 | 0 |
             IGenericDao dao = null;
685 | 0 |
             try {
686 | 0 |
                 dao = createDao(conn);
687 | 0 |
                 object = dao.read(objectMappingKey, sql, parameters);
688 |  |
             } catch (Exception e) {
689 | 0 |
                 throw new DAOException(e);
690 |  |
             }
691 | 0 |
             return object;
692 |  |
         }
693 |  |
694 |  |
         /**
695 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
696 |  |
          *      java.lang.String)
697 |  |
          */
698 | 0 |
         public Object read(Object objectMappingKey, String sql)
699 |  |
                 throws PersistenceException, DAOException {
700 | 0 |
             Object object;
701 | 0 |
             IGenericDao dao = null;
702 | 0 |
             try {
703 | 0 |
                 dao = createDao();
704 | 0 |
                 object = dao.read(objectMappingKey, sql);
705 |  |
             } catch (Exception e) {
706 | 0 |
                 throw new DAOException(e);
707 |  |
             } finally {
708 | 0 |
                 JdbcUtil.close(dao);
709 |  |
             }
710 | 0 |
             return object;
711 |  |
         }
712 |  |
713 |  |
         /**
714 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
715 |  |
          *      java.lang.String)
716 |  |
          */
717 | 0 |
         public Object read(Connection conn, Object objectMappingKey, String sql)
718 |  |
                 throws PersistenceException, DAOException {
719 | 0 |
             Object object;
720 | 0 |
             IGenericDao dao = null;
721 | 0 |
             try {
722 | 0 |
                 dao = createDao(conn);
723 | 0 |
                 object = dao.read(objectMappingKey, sql);
724 |  |
             } catch (Exception e) {
725 | 0 |
                 throw new DAOException(e);
726 |  |
             }
727 | 0 |
             return object;
728 |  |
         }
729 |  |
730 |  |
         /**
731 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readByPrimaryKey(java.lang.Object,
732 |  |
          *      java.lang.Object)
733 |  |
          */
734 | 0 |
         public Object readByPrimaryKey(Object objectMappingKey, Object primaryKey)
735 |  |
                 throws PersistenceException {
736 | 0 |
             Object object;
737 | 0 |
             IGenericDao dao = null;
738 | 0 |
             try {
739 | 0 |
                 dao = createDao();
740 | 0 |
                 object = dao.readByPrimaryKey(objectMappingKey, primaryKey);
741 |  |
             } catch (Exception e) {
742 | 0 |
                 throw new DAOException(e);
743 |  |
             } finally {
744 | 0 |
                 JdbcUtil.close(dao);
745 |  |
             }
746 | 0 |
             return object;
747 |  |
         }
748 |  |
749 |  |
         /**
750 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readByPrimaryKey(java.sql.Connection,
751 |  |
          *      java.lang.Object, java.lang.Object)
752 |  |
          */
753 | 0 |
         public Object readByPrimaryKey(Connection conn, Object objectMappingKey,
754 |  |
                 Object primaryKey) throws PersistenceException, DAOException {
755 | 0 |
             Object object;
756 | 0 |
             IGenericDao dao = null;
757 | 0 |
             try {
758 | 0 |
                 dao = createDao(conn);
759 | 0 |
                 object = dao.readByPrimaryKey(objectMappingKey, primaryKey);
760 |  |
             } catch (Exception e) {
761 | 0 |
                 throw new DAOException(e);
762 |  |
             }
763 | 0 |
             return object;
764 |  |
         }
765 |  |
766 |  |
         /**
767 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
768 |  |
          *      java.sql.PreparedStatement, com.jenkov.mrpersister.itf.IReadFilter)
769 |  |
          */
770 | 0 |
         public List readList(Object objectMappingKey, PreparedStatement statement,
771 |  |
                 IReadFilter filter) throws PersistenceException {
772 | 0 |
             List list;
773 | 0 |
             IGenericDao dao = null;
774 | 0 |
             try {
775 | 0 |
                 dao = createDao();
776 | 0 |
                 list = dao.readList(objectMappingKey, statement, filter);
777 |  |
             } catch (Exception e) {
778 | 0 |
                 throw new DAOException(e);
779 |  |
             } finally {
780 | 0 |
                 JdbcUtil.close(dao);
781 |  |
             }
782 | 0 |
             return list;
783 |  |
         }
784 |  |
785 |  |
         /**
786 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection,
787 |  |
          *      java.lang.Object, java.sql.PreparedStatement,
788 |  |
          *      com.jenkov.mrpersister.itf.IReadFilter)
789 |  |
          */
790 | 0 |
         public List readList(Connection conn, Object objectMappingKey,
791 |  |
                 PreparedStatement statement, IReadFilter filter)
792 |  |
                 throws PersistenceException, DAOException {
793 | 0 |
             List list;
794 | 0 |
             IGenericDao dao = null;
795 | 0 |
             try {
796 | 0 |
                 dao = createDao(conn);
797 | 0 |
                 list = dao.readList(objectMappingKey, statement, filter);
798 |  |
             } catch (Exception e) {
799 | 0 |
                 throw new DAOException(e);
800 |  |
             }
801 | 0 |
             return list;
802 |  |
         }
803 |  |
804 |  |
         /**
805 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
806 |  |
          *      java.sql.PreparedStatement)
807 |  |
          */
808 | 0 |
         public List readList(Object objectMappingKey, PreparedStatement statement)
809 |  |
                 throws PersistenceException {
810 | 0 |
             List list;
811 | 0 |
             IGenericDao dao = null;
812 | 0 |
             try {
813 | 0 |
                 dao = createDao();
814 | 0 |
                 list = dao.readList(objectMappingKey, statement);
815 |  |
             } catch (Exception e) {
816 | 0 |
                 throw new DAOException(e);
817 |  |
             } finally {
818 | 0 |
                 JdbcUtil.close(dao);
819 |  |
             }
820 | 0 |
             return list;
821 |  |
         }
822 |  |
823 |  |
         /**
824 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection,
825 |  |
          *      java.lang.Object, java.sql.PreparedStatement)
826 |  |
          */
827 | 0 |
         public List readList(Connection conn, Object objectMappingKey,
828 |  |
                 PreparedStatement statement) throws PersistenceException,
829 |  |
                 DAOException {
830 | 0 |
             List list;
831 | 0 |
             IGenericDao dao = null;
832 | 0 |
             try {
833 | 0 |
                 dao = createDao(conn);
834 | 0 |
                 list = dao.readList(objectMappingKey, statement);
835 |  |
             } catch (Exception e) {
836 | 0 |
                 throw new DAOException(e);
837 |  |
             }
838 | 0 |
             return list;
839 |  |
         }
840 |  |
841 |  |
         /**
842 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
843 |  |
          *      java.sql.ResultSet, com.jenkov.mrpersister.itf.IReadFilter)
844 |  |
          */
845 | 0 |
         public List readList(Object objectMappingKey, ResultSet result,
846 |  |
                 IReadFilter filter) throws PersistenceException {
847 | 0 |
             List list;
848 | 0 |
             IGenericDao dao = null;
849 | 0 |
             try {
850 | 0 |
                 dao = createDao();
851 | 0 |
                 list = dao.readList(objectMappingKey, result, filter);
852 |  |
             } catch (Exception e) {
853 | 0 |
                 throw new DAOException(e);
854 |  |
             } finally {
855 | 0 |
                 JdbcUtil.close(dao);
856 |  |
             }
857 | 0 |
             return list;
858 |  |
         }
859 |  |
860 |  |
         /**
861 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection,
862 |  |
          *      java.lang.Object, java.sql.ResultSet,
863 |  |
          *      com.jenkov.mrpersister.itf.IReadFilter)
864 |  |
          */
865 | 0 |
         public List readList(Connection conn, Object objectMappingKey,
866 |  |
                 ResultSet result, IReadFilter filter) throws PersistenceException,
867 |  |
                 DAOException {
868 | 0 |
             List list;
869 | 0 |
             IGenericDao dao = null;
870 | 0 |
             try {
871 | 0 |
                 dao = createDao(conn);
872 | 0 |
                 list = dao.readList(objectMappingKey, result, filter);
873 |  |
             } catch (Exception e) {
874 | 0 |
                 throw new DAOException(e);
875 |  |
             }
876 | 0 |
             return list;
877 |  |
         }
878 |  |
879 |  |
         /**
880 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
881 |  |
          *      java.sql.ResultSet)
882 |  |
          */
883 | 0 |
         public List readList(Object objectMappingKey, ResultSet result)
884 |  |
                 throws PersistenceException {
885 | 0 |
             List list;
886 | 0 |
             IGenericDao dao = null;
887 | 0 |
             try {
888 | 0 |
                 dao = createDao();
889 | 0 |
                 list = dao.readList(objectMappingKey, result);
890 |  |
             } catch (Exception e) {
891 | 0 |
                 throw new DAOException(e);
892 |  |
             } finally {
893 | 0 |
                 JdbcUtil.close(dao);
894 |  |
             }
895 | 0 |
             return list;
896 |  |
         }
897 |  |
898 |  |
         /**
899 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection,
900 |  |
          *      java.lang.Object, java.sql.ResultSet)
901 |  |
          */
902 | 0 |
         public List readList(Connection conn, Object objectMappingKey,
903 |  |
                 ResultSet result) throws PersistenceException, DAOException {
904 | 0 |
             List list;
905 | 0 |
             IGenericDao dao = null;
906 | 0 |
             try {
907 | 0 |
                 dao = createDao(conn);
908 | 0 |
                 list = dao.readList(objectMappingKey, result);
909 |  |
             } catch (Exception e) {
910 | 0 |
                 throw new DAOException(e);
911 |  |
             }
912 | 0 |
             return list;
913 |  |
         }
914 |  |
915 |  |
         /**
916 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
917 |  |
          *      java.sql.Statement, java.lang.String)
918 |  |
          */
919 | 0 |
         public List readList(Object objectMappingKey, Statement statement,
920 |  |
                 String sql) throws PersistenceException {
921 | 0 |
             List list;
922 | 0 |
             IGenericDao dao = null;
923 | 0 |
             try {
924 | 0 |
                 dao = createDao();
925 | 0 |
                 list = dao.readList(objectMappingKey, statement, sql);
926 |  |
             } catch (Exception e) {
927 | 0 |
                 throw new DAOException(e);
928 |  |
             } finally {
929 | 0 |
                 JdbcUtil.close(dao);
930 |  |
             }
931 | 0 |
             return list;
932 |  |
         }
933 |  |
934 |  |
         /**
935 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection,
936 |  |
          *      java.lang.Object, java.sql.Statement, java.lang.String)
937 |  |
          */
938 | 0 |
         public List readList(Connection conn, Object objectMappingKey,
939 |  |
                 Statement statement, String sql) throws PersistenceException,
940 |  |
                 DAOException {
941 | 0 |
             List list;
942 | 0 |
             IGenericDao dao = null;
943 | 0 |
             try {
944 | 0 |
                 dao = createDao(conn);
945 | 0 |
                 list = dao.readList(objectMappingKey, statement, sql);
946 |  |
             } catch (Exception e) {
947 | 0 |
                 throw new DAOException(e);
948 |  |
             }
949 | 0 |
             return list;
950 |  |
         }
951 |  |
952 |  |
         /**
953 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
954 |  |
          *      java.lang.String, java.util.Collection,
955 |  |
          *      com.jenkov.mrpersister.itf.IReadFilter)
956 |  |
          */
957 | 0 |
         public List readList(Object objectMappingKey, String sql,
958 |  |
                 Collection parameters, IReadFilter filter)
959 |  |
                 throws PersistenceException {
960 | 0 |
             List list;
961 | 0 |
             IGenericDao dao = null;
962 | 0 |
             try {
963 | 0 |
                 dao = createDao();
964 | 0 |
                 list = dao.readList(objectMappingKey, sql, parameters,
965 |  |
                         filter);
966 |  |
             } catch (Exception e) {
967 | 0 |
                 throw new DAOException(e);
968 |  |
             } finally {
969 | 0 |
                 JdbcUtil.close(dao);
970 |  |
             }
971 | 0 |
             return list;
972 |  |
         }
973 |  |
974 |  |
         /**
975 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection,
976 |  |
          *      java.lang.Object, java.lang.String, java.util.Collection,
977 |  |
          *      com.jenkov.mrpersister.itf.IReadFilter)
978 |  |
          */
979 | 0 |
         public List readList(Connection conn, Object objectMappingKey, String sql,
980 |  |
                 Collection parameters, IReadFilter filter)
981 |  |
                 throws PersistenceException, DAOException {
982 | 0 |
             List list;
983 | 0 |
             IGenericDao dao = null;
984 | 0 |
             try {
985 | 0 |
                 dao = createDao(conn);
986 | 0 |
                 list = dao.readList(objectMappingKey, sql, parameters,
987 |  |
                         filter);
988 |  |
             } catch (Exception e) {
989 | 0 |
                 throw new DAOException(e);
990 |  |
             }
991 | 0 |
             return list;
992 |  |
         }
993 |  |
994 |  |
         /**
995 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
996 |  |
          *      java.sql.Statement, java.lang.String,
997 |  |
          *      com.jenkov.mrpersister.itf.IReadFilter)
998 |  |
          */
999 | 0 |
         public List readList(Object objectMappingKey, Statement statement,
1000 |  |
                 String sql, IReadFilter filter) throws PersistenceException {
1001 | 0 |
             List list;
1002 | 0 |
             IGenericDao dao = null;
1003 | 0 |
             try {
1004 | 0 |
                 dao = createDao();
1005 | 0 |
                 list = dao
1006 |  |
                         .readList(objectMappingKey, statement, sql, filter);
1007 |  |
             } catch (Exception e) {
1008 | 0 |
                 throw new DAOException(e);
1009 |  |
             } finally {
1010 | 0 |
                 JdbcUtil.close(dao);
1011 |  |
             }
1012 | 0 |
             return list;
1013 |  |
         }
1014 |  |
1015 |  |
         /**
1016 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection,
1017 |  |
          *      java.lang.Object, java.sql.Statement, java.lang.String,
1018 |  |
          *      com.jenkov.mrpersister.itf.IReadFilter)
1019 |  |
          */
1020 | 0 |
         public List readList(Connection conn, Object objectMappingKey,
1021 |  |
                 Statement statement, String sql, IReadFilter filter)
1022 |  |
                 throws PersistenceException, DAOException {
1023 | 0 |
             List list;
1024 | 0 |
             IGenericDao dao = null;
1025 | 0 |
             try {
1026 | 0 |
                 dao = createDao(conn);
1027 | 0 |
                 list = dao
1028 |  |
                         .readList(objectMappingKey, statement, sql, filter);
1029 |  |
             } catch (Exception e) {
1030 | 0 |
                 throw new DAOException(e);
1031 |  |
             }
1032 | 0 |
             return list;
1033 |  |
         }
1034 |  |
1035 |  |
         /**
1036 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
1037 |  |
          *      java.lang.String, java.util.Collection)
1038 |  |
          */
1039 | 0 |
         public List readList(Object objectMappingKey, String sql,
1040 |  |
                 Collection parameters) throws PersistenceException, DAOException {
1041 | 0 |
             List list;
1042 | 0 |
             IGenericDao dao = null;
1043 | 0 |
             try {
1044 | 0 |
                 dao = createDao();
1045 | 0 |
                 list = dao.readList(objectMappingKey, sql, parameters);
1046 |  |
             } catch (Exception e) {
1047 | 0 |
                 throw new DAOException(e);
1048 |  |
             } finally {
1049 | 0 |
                 JdbcUtil.close(dao);
1050 |  |
             }
1051 | 0 |
             return list;
1052 |  |
         }
1053 |  |
1054 |  |
         /**
1055 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection,
1056 |  |
          *      java.lang.Object, java.lang.String, java.util.Collection)
1057 |  |
          */
1058 | 0 |
         public List readList(Connection conn, Object objectMappingKey, String sql,
1059 |  |
                 Collection parameters) throws PersistenceException, DAOException {
1060 | 0 |
             List list;
1061 | 0 |
             IGenericDao dao = null;
1062 | 0 |
             try {
1063 | 0 |
                 dao = createDao(conn);
1064 | 0 |
                 list = dao.readList(objectMappingKey, sql, parameters);
1065 |  |
             } catch (Exception e) {
1066 | 0 |
                 throw new DAOException(e);
1067 |  |
             }
1068 | 0 |
             return list;
1069 |  |
         }
1070 |  |
1071 |  |
         /**
1072 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
1073 |  |
          *      java.lang.String, com.jenkov.mrpersister.itf.IReadFilter)
1074 |  |
          */
1075 | 0 |
         public List readList(Object objectMappingKey, String sql, IReadFilter filter)
1076 |  |
                 throws PersistenceException {
1077 | 0 |
             List list;
1078 | 0 |
             IGenericDao dao = null;
1079 | 0 |
             try {
1080 | 0 |
                 dao = createDao();
1081 | 0 |
                 list = dao.readList(objectMappingKey, sql, filter);
1082 |  |
             } catch (Exception e) {
1083 | 0 |
                 throw new DAOException(e);
1084 |  |
             } finally {
1085 | 0 |
                 JdbcUtil.close(dao);
1086 |  |
             }
1087 | 0 |
             return list;
1088 |  |
         }
1089 |  |
1090 |  |
         /**
1091 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection, java.lang.Object, java.lang.String, com.jenkov.mrpersister.itf.IReadFilter)
1092 |  |
          */
1093 | 0 |
         public List readList(Connection conn, Object objectMappingKey, String sql,
1094 |  |
                 IReadFilter filter) throws PersistenceException, DAOException {
1095 | 0 |
             List list;
1096 | 0 |
             IGenericDao dao = null;
1097 | 0 |
             try {
1098 | 0 |
                 dao = createDao(conn);
1099 | 0 |
                 list = dao.readList(objectMappingKey, sql, filter);
1100 |  |
             } catch (Exception e) {
1101 | 0 |
                 throw new DAOException(e);
1102 |  |
             }
1103 | 0 |
             return list;
1104 |  |
         }
1105 |  |
1106 |  |
1107 |  |
         /**
1108 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
1109 |  |
          *      java.lang.String, java.lang.Object[],
1110 |  |
          *      com.jenkov.mrpersister.itf.IReadFilter)
1111 |  |
          */
1112 | 0 |
         public List readList(Object objectMappingKey, String sql,
1113 |  |
                 Object[] parameters, IReadFilter filter)
1114 |  |
                 throws PersistenceException {
1115 | 0 |
             List list;
1116 | 0 |
             IGenericDao dao = null;
1117 | 0 |
             try {
1118 | 0 |
                 dao = createDao();
1119 | 0 |
                 list = dao.readList(objectMappingKey, sql, parameters, filter);
1120 |  |
             } catch (Exception e) {
1121 | 0 |
                 throw new DAOException(e);
1122 |  |
             } finally {
1123 | 0 |
                 JdbcUtil.close(dao);
1124 |  |
             }
1125 | 0 |
             return list;
1126 |  |
         }
1127 |  |
1128 |  |
         /**
1129 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection, java.lang.Object, java.lang.String, java.lang.Object[], com.jenkov.mrpersister.itf.IReadFilter)
1130 |  |
          */
1131 | 0 |
         public List readList(Connection conn, Object objectMappingKey, String sql,
1132 |  |
                 Object[] parameters, IReadFilter filter)
1133 |  |
                 throws PersistenceException, DAOException {
1134 | 0 |
             List list;
1135 | 0 |
             IGenericDao dao = null;
1136 | 0 |
             try {
1137 | 0 |
                 dao = createDao(conn);
1138 | 0 |
                 list = dao.readList(objectMappingKey, sql, parameters, filter);
1139 |  |
             } catch (Exception e) {
1140 | 0 |
                 throw new DAOException(e);
1141 |  |
             }
1142 | 0 |
             return list;
1143 |  |
         }
1144 |  |
1145 |  |
1146 |  |
         /**
1147 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
1148 |  |
          *      java.lang.String, java.lang.Object[])
1149 |  |
          */
1150 | 0 |
         public List readList(Object objectMappingKey, String sql,
1151 |  |
                 Object[] parameters) throws PersistenceException {
1152 | 0 |
             List list;
1153 | 0 |
             IGenericDao dao = null;
1154 | 0 |
             try {
1155 | 0 |
                 dao = createDao();
1156 | 0 |
                 list = dao.readList(objectMappingKey, sql, parameters);
1157 |  |
             } catch (Exception e) {
1158 | 0 |
                 throw new DAOException(e);
1159 |  |
             } finally {
1160 | 0 |
                 JdbcUtil.close(dao);
1161 |  |
             }
1162 | 0 |
             return list;
1163 |  |
         }
1164 |  |
1165 |  |
         /**
1166 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection, java.lang.Object, java.lang.String, java.lang.Object[])
1167 |  |
          */
1168 | 0 |
         public List readList(Connection conn, Object objectMappingKey, String sql,
1169 |  |
                 Object[] parameters) throws PersistenceException, DAOException {
1170 | 0 |
             List list;
1171 | 0 |
             IGenericDao dao = null;
1172 | 0 |
             try {
1173 | 0 |
                 dao = createDao(conn);
1174 | 0 |
                 list = dao.readList(objectMappingKey, sql, parameters);
1175 |  |
             } catch (Exception e) {
1176 | 0 |
                 throw new DAOException(e);
1177 |  |
             }
1178 | 0 |
             return list;
1179 |  |
         }
1180 |  |
1181 |  |
1182 |  |
         /**
1183 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
1184 |  |
          *      java.lang.String)
1185 |  |
          */
1186 | 0 |
         public List readList(Object objectMappingKey, String sql)
1187 |  |
                 throws PersistenceException, DAOException {
1188 | 0 |
             List list;
1189 | 0 |
             IGenericDao dao = null;
1190 | 0 |
             try {
1191 | 0 |
                 dao = createDao();
1192 | 0 |
                 list = dao.readList(objectMappingKey, sql);
1193 |  |
             } catch (Exception e) {
1194 | 0 |
                 throw new DAOException(e);
1195 |  |
             } finally {
1196 | 0 |
                 JdbcUtil.close(dao);
1197 |  |
             }
1198 | 0 |
             return list;
1199 |  |
         }
1200 |  |
1201 |  |
         /**
1202 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.sql.Connection,
1203 |  |
          *      java.lang.Object, java.lang.String)
1204 |  |
          */
1205 | 0 |
         public List readList(Connection conn, Object objectMappingKey, String sql)
1206 |  |
                 throws PersistenceException, DAOException {
1207 | 0 |
             List list;
1208 | 0 |
             IGenericDao dao = null;
1209 | 0 |
             try {
1210 | 0 |
                 dao = createDao(conn);
1211 | 0 |
                 list = dao.readList(objectMappingKey, sql);
1212 |  |
             } catch (Exception e) {
1213 | 0 |
                 throw new DAOException(e);
1214 |  |
             }
1215 | 0 |
             return list;
1216 |  |
         }
1217 |  |
1218 |  |
         /**
1219 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readListByPrimaryKeys(java.lang.Object,
1220 |  |
          *      java.util.Collection)
1221 |  |
          */
1222 | 0 |
         public List readListByPrimaryKeys(Object objectMappingKey,
1223 |  |
                 Collection primaryKeys) throws PersistenceException {
1224 | 0 |
             List list;
1225 | 0 |
             IGenericDao dao = null;
1226 | 0 |
             try {
1227 | 0 |
                 dao = createDao();
1228 | 0 |
                 list = dao.readListByPrimaryKeys(objectMappingKey, primaryKeys);
1229 |  |
             } catch (Exception e) {
1230 | 0 |
                 throw new DAOException(e);
1231 |  |
             } finally {
1232 | 0 |
                 JdbcUtil.close(dao);
1233 |  |
             }
1234 | 0 |
             return list;
1235 |  |
         }
1236 |  |
1237 |  |
         /**
1238 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readListByPrimaryKeys(java.sql.Connection, java.lang.Object, java.util.Collection)
1239 |  |
          */
1240 | 0 |
         public List readListByPrimaryKeys(Connection conn, Object objectMappingKey,
1241 |  |
                 Collection primaryKeys) throws PersistenceException, DAOException {
1242 | 0 |
             List list;
1243 | 0 |
             IGenericDao dao = null;
1244 | 0 |
             try {
1245 | 0 |
                 dao = createDao(conn);
1246 | 0 |
                 list = dao.readListByPrimaryKeys(objectMappingKey, primaryKeys);
1247 |  |
             } catch (Exception e) {
1248 | 0 |
                 throw new DAOException(e);
1249 |  |
             }
1250 | 0 |
             return list;
1251 |  |
         }
1252 |  |
1253 |  |
         /**
1254 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#update(java.lang.Object,
1255 |  |
          *      java.lang.Object)
1256 |  |
          */
1257 | 0 |
         public int update(Object objectMappingKey, Object object)
1258 |  |
                 throws PersistenceException {
1259 | 0 |
             int nums = 0;
1260 | 0 |
             IGenericDao dao = null;
1261 | 0 |
             try {
1262 | 0 |
                 dao = createDao();
1263 | 0 |
                 nums = dao.update(objectMappingKey, object);
1264 |  |
             } catch (Exception e) {
1265 | 0 |
                 throw new DAOException(e);
1266 |  |
             } finally {
1267 | 0 |
                 JdbcUtil.close(dao);
1268 |  |
             }
1269 | 0 |
             return nums;
1270 |  |
         }
1271 |  |
1272 |  |
         /**
1273 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#update(java.sql.Connection, java.lang.Object, java.lang.Object)
1274 |  |
          */
1275 | 0 |
         public int update(Connection conn, Object objectMappingKey, Object object)
1276 |  |
                 throws PersistenceException, DAOException {
1277 | 0 |
             int nums = 0;
1278 | 0 |
             IGenericDao dao = null;
1279 | 0 |
             try {
1280 | 0 |
                 dao = createDao(conn);
1281 | 0 |
                 nums = dao.update(objectMappingKey, object);
1282 |  |
             } catch (Exception e) {
1283 | 0 |
                 throw new DAOException(e);
1284 |  |
             }
1285 | 0 |
             return nums;
1286 |  |
         }
1287 |  |
1288 |  |
1289 |  |
         /**
1290 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#update(java.lang.Object)
1291 |  |
          */
1292 | 0 |
         public int update(Object object) throws PersistenceException {
1293 | 0 |
             int nums = 0;
1294 | 0 |
             IGenericDao dao = null;
1295 | 0 |
             try {
1296 | 0 |
                 dao = createDao();
1297 | 0 |
                 nums = dao.update(object);
1298 |  |
             } catch (Exception e) {
1299 | 0 |
                 throw new DAOException(e);
1300 |  |
             } finally {
1301 | 0 |
                 JdbcUtil.close(dao);
1302 |  |
             }
1303 | 0 |
             return nums;
1304 |  |
         }
1305 |  |
1306 |  |
         /**
1307 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#update(java.sql.Connection, java.lang.Object)
1308 |  |
          */
1309 | 0 |
         public int update(Connection conn, Object object)
1310 |  |
                 throws PersistenceException, DAOException {
1311 | 0 |
             int nums = 0;
1312 | 0 |
             IGenericDao dao = null;
1313 | 0 |
             try {
1314 | 0 |
                 dao = createDao(conn);
1315 | 0 |
                 nums = dao.update(object);
1316 |  |
             } catch (Exception e) {
1317 | 0 |
                 throw new DAOException(e);
1318 |  |
             }
1319 | 0 |
             return nums;
1320 |  |
         }
1321 |  |
1322 |  |
1323 |  |
         /**
1324 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatch(java.util.Collection)
1325 |  |
          */
1326 | 0 |
         public int[] updateBatch(Collection objects) throws PersistenceException {
1327 | 0 |
             int[] nums;
1328 | 0 |
             IGenericDao dao = null;
1329 | 0 |
             try {
1330 | 0 |
                 dao = createDao();
1331 | 0 |
                 nums = dao.updateBatch(objects);
1332 |  |
             } catch (Exception e) {
1333 | 0 |
                 throw new DAOException(e);
1334 |  |
             } finally {
1335 | 0 |
                 JdbcUtil.close(dao);
1336 |  |
             }
1337 | 0 |
             return nums;
1338 |  |
         }
1339 |  |
1340 |  |
         /**
1341 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatch(java.sql.Connection, java.util.Collection)
1342 |  |
          */
1343 | 0 |
         public int[] updateBatch(Connection conn, Collection objects)
1344 |  |
                 throws PersistenceException, DAOException {
1345 | 0 |
             int[] nums;
1346 | 0 |
             IGenericDao dao = null;
1347 | 0 |
             try {
1348 | 0 |
                 dao = createDao(conn);
1349 | 0 |
                 nums = dao.updateBatch(objects);
1350 |  |
             } catch (Exception e) {
1351 | 0 |
                 throw new DAOException(e);
1352 |  |
             }
1353 | 0 |
             return nums;
1354 |  |
         }
1355 |  |
1356 |  |
         /**
1357 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatch(java.lang.Object,
1358 |  |
          *      java.util.Collection)
1359 |  |
          */
1360 | 0 |
         public int[] updateBatch(Object objectMappingKey, Collection objects)
1361 |  |
                 throws PersistenceException {
1362 | 0 |
             int[] nums;
1363 | 0 |
             IGenericDao dao = null;
1364 | 0 |
             try {
1365 | 0 |
                 dao = createDao();
1366 | 0 |
                 nums = dao.updateBatch(objectMappingKey, objects);
1367 |  |
             } catch (Exception e) {
1368 | 0 |
                 throw new DAOException(e);
1369 |  |
             } finally {
1370 | 0 |
                 JdbcUtil.close(dao);
1371 |  |
             }
1372 | 0 |
             return nums;
1373 |  |
         }
1374 |  |
1375 |  |
         /**
1376 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatch(java.sql.Connection, java.lang.Object, java.util.Collection)
1377 |  |
          */
1378 | 0 |
         public int[] updateBatch(Connection conn, Object objectMappingKey,
1379 |  |
                 Collection objects) throws PersistenceException, DAOException {
1380 | 0 |
             int[] nums;
1381 | 0 |
             IGenericDao dao = null;
1382 | 0 |
             try {
1383 | 0 |
                 dao = createDao(conn);
1384 | 0 |
                 nums = dao.updateBatch(objectMappingKey, objects);
1385 |  |
             } catch (Exception e) {
1386 | 0 |
                 throw new DAOException(e);
1387 |  |
             }
1388 | 0 |
             return nums;
1389 |  |
         }
1390 |  |
1391 |  |
1392 |  |
         /**
1393 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatchByPrimaryKeys(java.util.Collection,
1394 |  |
          *      java.util.Collection)
1395 |  |
          */
1396 | 0 |
         public int[] updateBatchByPrimaryKeys(Collection objects,
1397 |  |
                 Collection oldPrimaryKeys) throws PersistenceException {
1398 | 0 |
             int[] nums;
1399 | 0 |
             IGenericDao dao = null;
1400 | 0 |
             try {
1401 | 0 |
                 dao = createDao();
1402 | 0 |
                 nums = dao.updateBatch(objects, oldPrimaryKeys);
1403 |  |
             } catch (Exception e) {
1404 | 0 |
                 throw new DAOException(e);
1405 |  |
             } finally {
1406 | 0 |
                 JdbcUtil.close(dao);
1407 |  |
             }
1408 | 0 |
             return nums;
1409 |  |
         }
1410 |  |
1411 |  |
         /**
1412 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatchByPrimaryKeys(java.sql.Connection, java.util.Collection, java.util.Collection)
1413 |  |
          */
1414 | 0 |
         public int[] updateBatchByPrimaryKeys(Connection conn, Collection objects,
1415 |  |
                 Collection oldPrimaryKeys) throws PersistenceException,
1416 |  |
                 DAOException {
1417 | 0 |
             int[] nums;
1418 | 0 |
             IGenericDao dao = null;
1419 | 0 |
             try {
1420 | 0 |
                 dao = createDao(conn);
1421 | 0 |
                 nums = dao.updateBatch(objects, oldPrimaryKeys);
1422 |  |
             } catch (Exception e) {
1423 | 0 |
                 throw new DAOException(e);
1424 |  |
             }
1425 | 0 |
             return nums;
1426 |  |
         }
1427 |  |
1428 |  |
         /**
1429 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatchByPrimaryKeys(java.lang.Object,
1430 |  |
          *      java.util.Collection, java.util.Collection)
1431 |  |
          */
1432 | 0 |
         public int[] updateBatchByPrimaryKeys(Object objectMappingKey,
1433 |  |
                 Collection objects, Collection oldPrimaryKeys)
1434 |  |
                 throws PersistenceException {
1435 | 0 |
             int[] nums;
1436 | 0 |
             IGenericDao dao = null;
1437 | 0 |
             try {
1438 | 0 |
                 dao = createDao();
1439 | 0 |
                 nums = dao.updateBatchByPrimaryKeys(objectMappingKey, objects, oldPrimaryKeys);
1440 |  |
             } catch (Exception e) {
1441 | 0 |
                 throw new DAOException(e);
1442 |  |
             } finally {
1443 | 0 |
                 JdbcUtil.close(dao);
1444 |  |
             }
1445 | 0 |
             return nums;
1446 |  |
         }
1447 |  |
1448 |  |
         /**
1449 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatchByPrimaryKeys(java.sql.Connection, java.lang.Object, java.util.Collection, java.util.Collection)
1450 |  |
          */
1451 | 0 |
         public int[] updateBatchByPrimaryKeys(Connection conn,
1452 |  |
                 Object objectMappingKey, Collection objects,
1453 |  |
                 Collection oldPrimaryKeys) throws PersistenceException,
1454 |  |
                 DAOException {
1455 | 0 |
             int[] nums;
1456 | 0 |
             IGenericDao dao = null;
1457 | 0 |
             try {
1458 | 0 |
                 dao = createDao(conn);
1459 | 0 |
                 nums = dao.updateBatchByPrimaryKeys(objectMappingKey, objects, oldPrimaryKeys);
1460 |  |
             } catch (Exception e) {
1461 | 0 |
                 throw new DAOException(e);
1462 |  |
             }
1463 | 0 |
             return nums;
1464 |  |
         }
1465 |  |
1466 |  |
1467 |  |
         /**
1468 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateByPrimaryKey(java.lang.Object,
1469 |  |
          *      java.lang.Object, java.lang.Object)
1470 |  |
          */
1471 | 0 |
         public int updateByPrimaryKey(Object objectMappingKey, Object object,
1472 |  |
                 Object oldPrimaryKeyValue) throws PersistenceException {
1473 | 0 |
             int nums = 0;
1474 | 0 |
             IGenericDao dao = null;
1475 | 0 |
             try {
1476 | 0 |
                 dao = createDao();
1477 | 0 |
                 nums = dao.updateByPrimaryKey(objectMappingKey,object, oldPrimaryKeyValue);
1478 |  |
             } catch (Exception e) {
1479 | 0 |
                 throw new DAOException(e);
1480 |  |
             } finally {
1481 | 0 |
                 JdbcUtil.close(dao);
1482 |  |
             }
1483 | 0 |
             return nums;
1484 |  |
         }
1485 |  |
1486 |  |
         /**
1487 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateByPrimaryKey(java.sql.Connection, java.lang.Object, java.lang.Object, java.lang.Object)
1488 |  |
          */
1489 | 0 |
         public int updateByPrimaryKey(Connection conn, Object objectMappingKey,
1490 |  |
                 Object object, Object oldPrimaryKeyValue)
1491 |  |
                 throws PersistenceException, DAOException {
1492 | 0 |
             int nums = 0;
1493 | 0 |
             IGenericDao dao = null;
1494 | 0 |
             try {
1495 | 0 |
                 dao = createDao(conn);
1496 | 0 |
                 nums = dao.updateByPrimaryKey(objectMappingKey, object, oldPrimaryKeyValue);
1497 |  |
             } catch (Exception e) {
1498 | 0 |
                 throw new DAOException(e);
1499 |  |
             }
1500 | 0 |
             return nums;
1501 |  |
         }
1502 |  |
1503 |  |
1504 |  |
         /**
1505 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateByPrimaryKey(java.lang.Object,
1506 |  |
          *      java.lang.Object)
1507 |  |
          */
1508 | 0 |
         public int updateByPrimaryKey(Object object, Object oldPrimaryKeyValue)
1509 |  |
                 throws PersistenceException {
1510 | 0 |
             int nums = 0;
1511 | 0 |
             IGenericDao dao = null;
1512 | 0 |
             try {
1513 | 0 |
                 dao = createDao();
1514 | 0 |
                 nums = dao.updateByPrimaryKey(object, oldPrimaryKeyValue);
1515 |  |
             } catch (Exception e) {
1516 | 0 |
                 throw new DAOException(e);
1517 |  |
             } finally {
1518 | 0 |
                 JdbcUtil.close(dao);
1519 |  |
             }
1520 | 0 |
             return nums;
1521 |  |
         }
1522 |  |
1523 |  |
         /**
1524 |  |
          * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateByPrimaryKey(java.sql.Connection, java.lang.Object, java.lang.Object)
1525 |  |
          */
1526 | 0 |
         public int updateByPrimaryKey(Connection conn, Object object,
1527 |  |
                 Object oldPrimaryKeyValue) throws PersistenceException,
1528 |  |
                 DAOException {
1529 | 0 |
             int nums = 0;
1530 | 0 |
             IGenericDao dao = null;
1531 | 0 |
             try {
1532 | 0 |
                 dao = createDao(conn);
1533 | 0 |
                 nums = dao.updateByPrimaryKey(object, oldPrimaryKeyValue);
1534 |  |
             } catch (Exception e) {
1535 | 0 |
                 throw new DAOException(e);
1536 |  |
             }
1537 | 0 |
             return nums;
1538 |  |
         }
1539 |  |
     }