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