View Javadoc

    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  	public MrPersisterServiceImpl() {
    45  		this.pm = new PersistenceManager();
    46  	}
    47
    48  	/***
    49  	 * @param dataSource
    50  	 *            The dataSource to set.
    51  	 */
    52  	public void setDataSource(DataSource dataSource) {
    53  		this.dataSource = dataSource;
    54  	}
    55
    56  	private IGenericDao createDao() throws SQLException {
    57  		return pm.getGenericDaoFactory().createDao(dataSource.getConnection());
    58  	}
    59
    60  	private IGenericDao createDao(Connection conn) throws SQLException {
    61  		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  	public int delete(Connection conn, Object object)
    69  			throws PersistenceException, DAOException {
    70  		int rows = 0;
    71  		IGenericDao dao = null;
    72  		try {
    73  			dao = createDao(conn);
    74  			rows = dao.delete(object);
    75  		} catch (Exception e) {
    76  			throw new DAOException(e);
    77  		}
    78  		return rows;
    79  	}
    80
    81  	/***
    82  	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#delete(java.lang.Object)
    83  	 */
    84  	public int delete(Object object) throws PersistenceException, DAOException {
    85  		int rows = 0;
    86  		IGenericDao dao = null;
    87  		try {
    88  			dao = createDao();
    89  			rows = dao.delete(object);
    90  		} catch (Exception e) {
    91  			throw new DAOException(e);
    92  		} finally {
    93  			JdbcUtil.close(dao);
    94  		}
    95  		return rows;
    96  	}
    97
    98  	/***
    99  	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#delete(java.lang.Object,
    100 	 *      java.lang.Object)
    101 	 */
    102 	public int delete(Object objectMappingKey, Object object)
    103 			throws PersistenceException, DAOException {
    104 		int rows = 0;
    105 		IGenericDao dao = null;
    106 		try {
    107 			dao = createDao();
    108 			rows = dao.delete(objectMappingKey, object);
    109 		} catch (Exception e) {
    110 			throw new DAOException(e);
    111 		} finally {
    112 			JdbcUtil.close(dao);
    113 		}
    114 		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 	public int delete(Connection conn, Object objectMappingKey, Object object)
    122 			throws PersistenceException, DAOException {
    123 		int rows = 0;
    124 		IGenericDao dao = null;
    125 		try {
    126 			dao = createDao(conn);
    127 			rows = dao.delete(objectMappingKey, object);
    128 		} catch (Exception e) {
    129 			throw new DAOException(e);
    130 		}
    131 		return rows;
    132 	}
    133
    134 	/***
    135 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteBatch(java.util.Collection)
    136 	 */
    137 	public int[] deleteBatch(Collection objects) throws PersistenceException,
    138 			DAOException {
    139 		int[] rows;
    140 		IGenericDao dao = null;
    141 		try {
    142 			dao = createDao();
    143 			rows = dao.deleteBatch(objects);
    144 		} catch (Exception e) {
    145 			throw new DAOException(e);
    146 		} finally {
    147 			JdbcUtil.close(dao);
    148 		}
    149 		return rows;
    150 	}
    151
    152 	/***
    153 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteBatch(java.sql.Connection,
    154 	 *      java.util.Collection)
    155 	 */
    156 	public int[] deleteBatch(Connection conn, Collection objects)
    157 			throws PersistenceException, DAOException {
    158 		int[] rows;
    159 		IGenericDao dao = null;
    160 		try {
    161 			dao = createDao(conn);
    162 			rows = dao.deleteBatch(objects);
    163 		} catch (Exception e) {
    164 			throw new DAOException(e);
    165 		}
    166 		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 	public int[] deleteBatch(Connection conn, Object objectMappingKey,
    174 			Collection objects) throws PersistenceException, DAOException {
    175 		int[] rows;
    176 		IGenericDao dao = null;
    177 		try {
    178 			dao = createDao(conn);
    179 			rows = dao.deleteBatch(objectMappingKey, objects);
    180 		} catch (Exception e) {
    181 			throw new DAOException(e);
    182 		}
    183 		return rows;
    184 	}
    185
    186 	/***
    187 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteBatch(java.lang.Object,
    188 	 *      java.util.Collection)
    189 	 */
    190 	public int[] deleteBatch(Object objectMappingKey, Collection objects)
    191 			throws PersistenceException, DAOException {
    192 		int[] rows;
    193 		IGenericDao dao = null;
    194 		try {
    195 			dao = createDao();
    196 			rows = dao.deleteBatch(objectMappingKey, objects);
    197 		} catch (Exception e) {
    198 			throw new DAOException(e);
    199 		} finally {
    200 			JdbcUtil.close(dao);
    201 		}
    202 		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 	public int deleteByPrimaryKey(Connection conn, Object objectMappingKey,
    210 			Object primaryKey) throws PersistenceException, DAOException {
    211 		int rows = 0;
    212 		IGenericDao dao = null;
    213 		try {
    214 			dao = createDao(conn);
    215 			rows = dao.deleteByPrimaryKey(objectMappingKey, primaryKey);
    216 		} catch (Exception e) {
    217 			throw new DAOException(e);
    218 		}
    219 		return rows;
    220 	}
    221
    222 	/***
    223 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteByPrimaryKey(java.lang.Object,
    224 	 *      java.lang.Object)
    225 	 */
    226 	public int deleteByPrimaryKey(Object objectMappingKey, Object primaryKey)
    227 			throws PersistenceException, DAOException {
    228 		int rows = 0;
    229 		IGenericDao dao = null;
    230 		try {
    231 			dao = createDao();
    232 			rows = dao.deleteByPrimaryKey(objectMappingKey, primaryKey);
    233 		} catch (Exception e) {
    234 			throw new DAOException(e);
    235 		} finally {
    236 			JdbcUtil.close(dao);
    237 		}
    238 		return rows;
    239 	}
    240
    241 	/***
    242 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#deleteBatchByPrimaryKeys(java.lang.Object,
    243 	 *      java.util.Collection)
    244 	 */
    245 	public int[] deleteBatchByPrimaryKeys(Object objectMappingKey,
    246 			Collection primaryKeys) throws PersistenceException, DAOException {
    247 		int[] rows;
    248 		IGenericDao dao = null;
    249 		try {
    250 			dao = createDao();
    251 			rows = dao.deleteBatchByPrimaryKeys(objectMappingKey,
    252 					primaryKeys);
    253 		} catch (Exception e) {
    254 			throw new DAOException(e);
    255 		} finally {
    256 			JdbcUtil.close(dao);
    257 		}
    258 		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 	public int[] deleteBatchByPrimaryKeys(Connection conn,
    266 			Object objectMappingKey, Collection primaryKeys)
    267 			throws PersistenceException, DAOException {
    268 		int[] rows;
    269 		IGenericDao dao = null;
    270 		try {
    271 			dao = createDao(conn);
    272 			rows = dao.deleteBatchByPrimaryKeys(objectMappingKey,
    273 					primaryKeys);
    274 		} catch (Exception e) {
    275 			throw new DAOException(e);
    276 		}
    277 		return rows;
    278 	}
    279
    280 	/***
    281 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#executeUpdate(java.lang.String,
    282 	 *      java.util.Collection)
    283 	 */
    284 	public int executeUpdate(String sql, Collection parameters)
    285 			throws PersistenceException {
    286 		int nums = 0;
    287 		IGenericDao dao = null;
    288 		try {
    289 			dao = createDao();
    290 			nums = dao.executeUpdate(sql, parameters);
    291 		} catch (Exception e) {
    292 			throw new DAOException(e);
    293 		} finally {
    294 			JdbcUtil.close(dao);
    295 		}
    296 		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 	public int executeUpdate(Connection conn, String sql, Collection parameters)
    304 			throws PersistenceException, DAOException {
    305 		int nums = 0;
    306 		IGenericDao dao = null;
    307 		try {
    308 			dao = createDao(conn);
    309 			nums = dao.executeUpdate(sql, parameters);
    310 		} catch (Exception e) {
    311 			throw new DAOException(e);
    312 		}
    313 		return nums;
    314 	}
    315
    316 	/***
    317 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#executeUpdate(java.lang.String,
    318 	 *      java.lang.Object[])
    319 	 */
    320 	public int executeUpdate(String sql, Object[] parameters)
    321 			throws PersistenceException {
    322 		int nums = 0;
    323 		IGenericDao dao = null;
    324 		try {
    325 			dao = createDao();
    326 			nums = dao.executeUpdate(sql, parameters);
    327 		} catch (Exception e) {
    328 			throw new DAOException(e);
    329 		} finally {
    330 			JdbcUtil.close(dao);
    331 		}
    332 		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 	public int executeUpdate(Connection conn, String sql, Object[] parameters)
    340 			throws PersistenceException, DAOException {
    341 		int nums = 0;
    342 		IGenericDao dao = null;
    343 		try {
    344 			dao = createDao(conn);
    345 			nums = dao.executeUpdate(sql, parameters);
    346 		} catch (Exception e) {
    347 			throw new DAOException(e);
    348 		}
    349 		return nums;
    350 	}
    351
    352 	/***
    353 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#executeUpdate(java.lang.String)
    354 	 */
    355 	public int executeUpdate(String sql) throws PersistenceException,
    356 			DAOException {
    357 		int nums = 0;
    358 		IGenericDao dao = null;
    359 		try {
    360 			dao = createDao();
    361 			nums = dao.executeUpdate(sql);
    362 		} catch (Exception e) {
    363 			throw new DAOException(e);
    364 		} finally {
    365 			JdbcUtil.close(dao);
    366 		}
    367 		return nums;
    368 	}
    369
    370 	/***
    371 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#executeUpdate(java.sql.Connection,
    372 	 *      java.lang.String)
    373 	 */
    374 	public int executeUpdate(Connection conn, String sql)
    375 			throws PersistenceException, DAOException {
    376 		int nums = 0;
    377 		IGenericDao dao = null;
    378 		try {
    379 			dao = createDao(conn);
    380 			nums = dao.executeUpdate(sql);
    381 		} catch (Exception e) {
    382 			throw new DAOException(e);
    383 		}
    384 		return nums;
    385 	}
    386
    387 	/***
    388 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insert(java.lang.Object,
    389 	 *      java.lang.Object)
    390 	 */
    391 	public int insert(Object objectMappingKey, Object object)
    392 			throws PersistenceException {
    393 		int nums = 0;
    394 		IGenericDao dao = null;
    395 		try {
    396 			dao = createDao();
    397 			nums = dao.insert(objectMappingKey, object);
    398 		} catch (Exception e) {
    399 			throw new DAOException(e);
    400 		} finally {
    401 			JdbcUtil.close(dao);
    402 		}
    403 		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 	public int insert(Connection conn, Object objectMappingKey, Object object)
    411 			throws PersistenceException, DAOException {
    412 		int nums = 0;
    413 		IGenericDao dao = null;
    414 		try {
    415 			dao = createDao(conn);
    416 			nums = dao.insert(objectMappingKey, object);
    417 		} catch (Exception e) {
    418 			throw new DAOException(e);
    419 		}
    420 		return nums;
    421 	}
    422
    423 	/***
    424 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insert(java.lang.Object)
    425 	 */
    426 	public int insert(Object object) throws PersistenceException {
    427 		int nums = 0;
    428 		IGenericDao dao = null;
    429 		try {
    430 			dao = createDao();
    431 			nums = dao.insert(object);
    432 		} catch (Exception e) {
    433 			throw new DAOException(e);
    434 		} finally {
    435 			JdbcUtil.close(dao);
    436 		}
    437 		return nums;
    438 	}
    439
    440 	/***
    441 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insert(java.sql.Connection,
    442 	 *      java.lang.Object)
    443 	 */
    444 	public int insert(Connection conn, Object object)
    445 			throws PersistenceException, DAOException {
    446 		int nums = 0;
    447 		IGenericDao dao = null;
    448 		try {
    449 			dao = createDao(conn);
    450 			nums = dao.insert(object);
    451 		} catch (Exception e) {
    452 			throw new DAOException(e);
    453 		}
    454 		return nums;
    455 	}
    456
    457 	/*
    458 	 * 8
    459 	 *
    460 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insertBatch(java.util.Collection)
    461 	 */
    462 	public int[] insertBatch(Collection objects) throws PersistenceException {
    463 		int[] nums;
    464 		IGenericDao dao = null;
    465 		try {
    466 			dao = createDao();
    467 			nums = dao.insertBatch(objects);
    468 		} catch (Exception e) {
    469 			throw new DAOException(e);
    470 		} finally {
    471 			JdbcUtil.close(dao);
    472 		}
    473 		return nums;
    474 	}
    475
    476 	/***
    477 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insertBatch(java.lang.Object,
    478 	 *      java.util.Collection)
    479 	 */
    480 	public int[] insertBatch(Object objectMappingKey, Collection objects)
    481 			throws PersistenceException {
    482 		int[] nums;
    483 		IGenericDao dao = null;
    484 		try {
    485 			dao = createDao();
    486 			nums = dao.insertBatch(objects);
    487 		} catch (Exception e) {
    488 			throw new DAOException(e);
    489 		} finally {
    490 			JdbcUtil.close(dao);
    491 		}
    492 		return nums;
    493 	}
    494
    495 	/***
    496 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#insertBatch(java.sql.Connection,
    497 	 *      java.util.Collection)
    498 	 */
    499 	public int[] insertBatch(Connection conn, Collection objects)
    500 			throws PersistenceException, DAOException {
    501 		int[] nums;
    502 		IGenericDao dao = null;
    503 		try {
    504 			dao = createDao(conn);
    505 			nums = dao.insertBatch(objects);
    506 		} catch (Exception e) {
    507 			throw new DAOException(e);
    508 		}
    509 		return nums;
    510 	}
    511
    512 	/***
    513 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
    514 	 *      java.sql.PreparedStatement)
    515 	 */
    516 	public Object read(Object objectMappingKey, PreparedStatement statement)
    517 			throws PersistenceException {
    518 		Object object;
    519 		IGenericDao dao = null;
    520 		try {
    521 			dao = createDao();
    522 			object = dao.read(objectMappingKey, statement);
    523 		} catch (Exception e) {
    524 			throw new DAOException(e);
    525 		} finally {
    526 			JdbcUtil.close(dao);
    527 		}
    528 		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 	public Object read(Connection conn, Object objectMappingKey,
    536 			PreparedStatement statement) throws PersistenceException,
    537 			DAOException {
    538 		Object object;
    539 		IGenericDao dao = null;
    540 		try {
    541 			dao = createDao(conn);
    542 			object = dao.read(objectMappingKey, statement);
    543 		} catch (Exception e) {
    544 			throw new DAOException(e);
    545 		}
    546 		return object;
    547 	}
    548
    549 	/***
    550 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
    551 	 *      java.sql.ResultSet)
    552 	 */
    553 	public Object read(Object objectMappingKey, ResultSet result)
    554 			throws PersistenceException {
    555 		Object object;
    556 		IGenericDao dao = null;
    557 		try {
    558 			dao = createDao();
    559 			object = dao.read(objectMappingKey, result);
    560 		} catch (Exception e) {
    561 			throw new DAOException(e);
    562 		} finally {
    563 			JdbcUtil.close(dao);
    564 		}
    565 		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 	public Object read(Connection conn, Object objectMappingKey,
    573 			ResultSet result) throws PersistenceException, DAOException {
    574 		Object object;
    575 		IGenericDao dao = null;
    576 		try {
    577 			dao = createDao(conn);
    578 			object = dao.read(objectMappingKey, result);
    579 		} catch (Exception e) {
    580 			throw new DAOException(e);
    581 		}
    582 		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 	public Object read(Object objectMappingKey, Statement statement, String sql)
    590 			throws PersistenceException, DAOException {
    591 		Object object;
    592 		IGenericDao dao = null;
    593 		try {
    594 			dao = createDao();
    595 			object = dao.read(objectMappingKey, statement, sql);
    596 		} catch (Exception e) {
    597 			throw new DAOException(e);
    598 		} finally {
    599 			JdbcUtil.close(dao);
    600 		}
    601 		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 	public Object read(Connection conn, Object objectMappingKey,
    609 			Statement statement, String sql) throws PersistenceException,
    610 			DAOException {
    611 		Object object;
    612 		IGenericDao dao = null;
    613 		try {
    614 			dao = createDao(conn);
    615 			object = dao.read(objectMappingKey, statement, sql);
    616 		} catch (Exception e) {
    617 			throw new DAOException(e);
    618 		}
    619 		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 	public Object read(Object objectMappingKey, String sql,
    627 			Collection parameters) throws PersistenceException {
    628 		Object object;
    629 		IGenericDao dao = null;
    630 		try {
    631 			dao = createDao();
    632 			object = dao.read(objectMappingKey, sql, parameters);
    633 		} catch (Exception e) {
    634 			throw new DAOException(e);
    635 		} finally {
    636 			JdbcUtil.close(dao);
    637 		}
    638 		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 	public Object read(Connection conn, Object objectMappingKey, String sql,
    646 			Collection parameters) throws PersistenceException, DAOException {
    647 		Object object;
    648 		IGenericDao dao = null;
    649 		try {
    650 			dao = createDao(conn);
    651 			object = dao.read(objectMappingKey, sql, parameters);
    652 		} catch (Exception e) {
    653 			throw new DAOException(e);
    654 		}
    655 		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 	public Object read(Object objectMappingKey, String sql, Object[] parameters)
    663 			throws PersistenceException {
    664 		Object object;
    665 		IGenericDao dao = null;
    666 		try {
    667 			dao = createDao();
    668 			object = dao.read(objectMappingKey, sql, parameters);
    669 		} catch (Exception e) {
    670 			throw new DAOException(e);
    671 		} finally {
    672 			JdbcUtil.close(dao);
    673 		}
    674 		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 	public Object read(Connection conn, Object objectMappingKey, String sql,
    682 			Object[] parameters) throws PersistenceException, DAOException {
    683 		Object object;
    684 		IGenericDao dao = null;
    685 		try {
    686 			dao = createDao(conn);
    687 			object = dao.read(objectMappingKey, sql, parameters);
    688 		} catch (Exception e) {
    689 			throw new DAOException(e);
    690 		}
    691 		return object;
    692 	}
    693
    694 	/***
    695 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
    696 	 *      java.lang.String)
    697 	 */
    698 	public Object read(Object objectMappingKey, String sql)
    699 			throws PersistenceException, DAOException {
    700 		Object object;
    701 		IGenericDao dao = null;
    702 		try {
    703 			dao = createDao();
    704 			object = dao.read(objectMappingKey, sql);
    705 		} catch (Exception e) {
    706 			throw new DAOException(e);
    707 		} finally {
    708 			JdbcUtil.close(dao);
    709 		}
    710 		return object;
    711 	}
    712
    713 	/***
    714 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#read(java.lang.Object,
    715 	 *      java.lang.String)
    716 	 */
    717 	public Object read(Connection conn, Object objectMappingKey, String sql)
    718 			throws PersistenceException, DAOException {
    719 		Object object;
    720 		IGenericDao dao = null;
    721 		try {
    722 			dao = createDao(conn);
    723 			object = dao.read(objectMappingKey, sql);
    724 		} catch (Exception e) {
    725 			throw new DAOException(e);
    726 		}
    727 		return object;
    728 	}
    729
    730 	/***
    731 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readByPrimaryKey(java.lang.Object,
    732 	 *      java.lang.Object)
    733 	 */
    734 	public Object readByPrimaryKey(Object objectMappingKey, Object primaryKey)
    735 			throws PersistenceException {
    736 		Object object;
    737 		IGenericDao dao = null;
    738 		try {
    739 			dao = createDao();
    740 			object = dao.readByPrimaryKey(objectMappingKey, primaryKey);
    741 		} catch (Exception e) {
    742 			throw new DAOException(e);
    743 		} finally {
    744 			JdbcUtil.close(dao);
    745 		}
    746 		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 	public Object readByPrimaryKey(Connection conn, Object objectMappingKey,
    754 			Object primaryKey) throws PersistenceException, DAOException {
    755 		Object object;
    756 		IGenericDao dao = null;
    757 		try {
    758 			dao = createDao(conn);
    759 			object = dao.readByPrimaryKey(objectMappingKey, primaryKey);
    760 		} catch (Exception e) {
    761 			throw new DAOException(e);
    762 		}
    763 		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 	public List readList(Object objectMappingKey, PreparedStatement statement,
    771 			IReadFilter filter) throws PersistenceException {
    772 		List list;
    773 		IGenericDao dao = null;
    774 		try {
    775 			dao = createDao();
    776 			list = dao.readList(objectMappingKey, statement, filter);
    777 		} catch (Exception e) {
    778 			throw new DAOException(e);
    779 		} finally {
    780 			JdbcUtil.close(dao);
    781 		}
    782 		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 	public List readList(Connection conn, Object objectMappingKey,
    791 			PreparedStatement statement, IReadFilter filter)
    792 			throws PersistenceException, DAOException {
    793 		List list;
    794 		IGenericDao dao = null;
    795 		try {
    796 			dao = createDao(conn);
    797 			list = dao.readList(objectMappingKey, statement, filter);
    798 		} catch (Exception e) {
    799 			throw new DAOException(e);
    800 		}
    801 		return list;
    802 	}
    803
    804 	/***
    805 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
    806 	 *      java.sql.PreparedStatement)
    807 	 */
    808 	public List readList(Object objectMappingKey, PreparedStatement statement)
    809 			throws PersistenceException {
    810 		List list;
    811 		IGenericDao dao = null;
    812 		try {
    813 			dao = createDao();
    814 			list = dao.readList(objectMappingKey, statement);
    815 		} catch (Exception e) {
    816 			throw new DAOException(e);
    817 		} finally {
    818 			JdbcUtil.close(dao);
    819 		}
    820 		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 	public List readList(Connection conn, Object objectMappingKey,
    828 			PreparedStatement statement) throws PersistenceException,
    829 			DAOException {
    830 		List list;
    831 		IGenericDao dao = null;
    832 		try {
    833 			dao = createDao(conn);
    834 			list = dao.readList(objectMappingKey, statement);
    835 		} catch (Exception e) {
    836 			throw new DAOException(e);
    837 		}
    838 		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 	public List readList(Object objectMappingKey, ResultSet result,
    846 			IReadFilter filter) throws PersistenceException {
    847 		List list;
    848 		IGenericDao dao = null;
    849 		try {
    850 			dao = createDao();
    851 			list = dao.readList(objectMappingKey, result, filter);
    852 		} catch (Exception e) {
    853 			throw new DAOException(e);
    854 		} finally {
    855 			JdbcUtil.close(dao);
    856 		}
    857 		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 	public List readList(Connection conn, Object objectMappingKey,
    866 			ResultSet result, IReadFilter filter) throws PersistenceException,
    867 			DAOException {
    868 		List list;
    869 		IGenericDao dao = null;
    870 		try {
    871 			dao = createDao(conn);
    872 			list = dao.readList(objectMappingKey, result, filter);
    873 		} catch (Exception e) {
    874 			throw new DAOException(e);
    875 		}
    876 		return list;
    877 	}
    878
    879 	/***
    880 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readList(java.lang.Object,
    881 	 *      java.sql.ResultSet)
    882 	 */
    883 	public List readList(Object objectMappingKey, ResultSet result)
    884 			throws PersistenceException {
    885 		List list;
    886 		IGenericDao dao = null;
    887 		try {
    888 			dao = createDao();
    889 			list = dao.readList(objectMappingKey, result);
    890 		} catch (Exception e) {
    891 			throw new DAOException(e);
    892 		} finally {
    893 			JdbcUtil.close(dao);
    894 		}
    895 		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 	public List readList(Connection conn, Object objectMappingKey,
    903 			ResultSet result) throws PersistenceException, DAOException {
    904 		List list;
    905 		IGenericDao dao = null;
    906 		try {
    907 			dao = createDao(conn);
    908 			list = dao.readList(objectMappingKey, result);
    909 		} catch (Exception e) {
    910 			throw new DAOException(e);
    911 		}
    912 		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 	public List readList(Object objectMappingKey, Statement statement,
    920 			String sql) throws PersistenceException {
    921 		List list;
    922 		IGenericDao dao = null;
    923 		try {
    924 			dao = createDao();
    925 			list = dao.readList(objectMappingKey, statement, sql);
    926 		} catch (Exception e) {
    927 			throw new DAOException(e);
    928 		} finally {
    929 			JdbcUtil.close(dao);
    930 		}
    931 		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 	public List readList(Connection conn, Object objectMappingKey,
    939 			Statement statement, String sql) throws PersistenceException,
    940 			DAOException {
    941 		List list;
    942 		IGenericDao dao = null;
    943 		try {
    944 			dao = createDao(conn);
    945 			list = dao.readList(objectMappingKey, statement, sql);
    946 		} catch (Exception e) {
    947 			throw new DAOException(e);
    948 		}
    949 		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 	public List readList(Object objectMappingKey, String sql,
    958 			Collection parameters, IReadFilter filter)
    959 			throws PersistenceException {
    960 		List list;
    961 		IGenericDao dao = null;
    962 		try {
    963 			dao = createDao();
    964 			list = dao.readList(objectMappingKey, sql, parameters,
    965 					filter);
    966 		} catch (Exception e) {
    967 			throw new DAOException(e);
    968 		} finally {
    969 			JdbcUtil.close(dao);
    970 		}
    971 		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 	public List readList(Connection conn, Object objectMappingKey, String sql,
    980 			Collection parameters, IReadFilter filter)
    981 			throws PersistenceException, DAOException {
    982 		List list;
    983 		IGenericDao dao = null;
    984 		try {
    985 			dao = createDao(conn);
    986 			list = dao.readList(objectMappingKey, sql, parameters,
    987 					filter);
    988 		} catch (Exception e) {
    989 			throw new DAOException(e);
    990 		}
    991 		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 	public List readList(Object objectMappingKey, Statement statement,
    1000 			String sql, IReadFilter filter) throws PersistenceException {
    1001 		List list;
    1002 		IGenericDao dao = null;
    1003 		try {
    1004 			dao = createDao();
    1005 			list = dao
    1006 					.readList(objectMappingKey, statement, sql, filter);
    1007 		} catch (Exception e) {
    1008 			throw new DAOException(e);
    1009 		} finally {
    1010 			JdbcUtil.close(dao);
    1011 		}
    1012 		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 	public List readList(Connection conn, Object objectMappingKey,
    1021 			Statement statement, String sql, IReadFilter filter)
    1022 			throws PersistenceException, DAOException {
    1023 		List list;
    1024 		IGenericDao dao = null;
    1025 		try {
    1026 			dao = createDao(conn);
    1027 			list = dao
    1028 					.readList(objectMappingKey, statement, sql, filter);
    1029 		} catch (Exception e) {
    1030 			throw new DAOException(e);
    1031 		}
    1032 		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 	public List readList(Object objectMappingKey, String sql,
    1040 			Collection parameters) throws PersistenceException, DAOException {
    1041 		List list;
    1042 		IGenericDao dao = null;
    1043 		try {
    1044 			dao = createDao();
    1045 			list = dao.readList(objectMappingKey, sql, parameters);
    1046 		} catch (Exception e) {
    1047 			throw new DAOException(e);
    1048 		} finally {
    1049 			JdbcUtil.close(dao);
    1050 		}
    1051 		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 	public List readList(Connection conn, Object objectMappingKey, String sql,
    1059 			Collection parameters) throws PersistenceException, DAOException {
    1060 		List list;
    1061 		IGenericDao dao = null;
    1062 		try {
    1063 			dao = createDao(conn);
    1064 			list = dao.readList(objectMappingKey, sql, parameters);
    1065 		} catch (Exception e) {
    1066 			throw new DAOException(e);
    1067 		}
    1068 		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 	public List readList(Object objectMappingKey, String sql, IReadFilter filter)
    1076 			throws PersistenceException {
    1077 		List list;
    1078 		IGenericDao dao = null;
    1079 		try {
    1080 			dao = createDao();
    1081 			list = dao.readList(objectMappingKey, sql, filter);
    1082 		} catch (Exception e) {
    1083 			throw new DAOException(e);
    1084 		} finally {
    1085 			JdbcUtil.close(dao);
    1086 		}
    1087 		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 	public List readList(Connection conn, Object objectMappingKey, String sql,
    1094 			IReadFilter filter) throws PersistenceException, DAOException {
    1095 		List list;
    1096 		IGenericDao dao = null;
    1097 		try {
    1098 			dao = createDao(conn);
    1099 			list = dao.readList(objectMappingKey, sql, filter);
    1100 		} catch (Exception e) {
    1101 			throw new DAOException(e);
    1102 		}
    1103 		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 	public List readList(Object objectMappingKey, String sql,
    1113 			Object[] parameters, IReadFilter filter)
    1114 			throws PersistenceException {
    1115 		List list;
    1116 		IGenericDao dao = null;
    1117 		try {
    1118 			dao = createDao();
    1119 			list = dao.readList(objectMappingKey, sql, parameters, filter);
    1120 		} catch (Exception e) {
    1121 			throw new DAOException(e);
    1122 		} finally {
    1123 			JdbcUtil.close(dao);
    1124 		}
    1125 		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 	public List readList(Connection conn, Object objectMappingKey, String sql,
    1132 			Object[] parameters, IReadFilter filter)
    1133 			throws PersistenceException, DAOException {
    1134 		List list;
    1135 		IGenericDao dao = null;
    1136 		try {
    1137 			dao = createDao(conn);
    1138 			list = dao.readList(objectMappingKey, sql, parameters, filter);
    1139 		} catch (Exception e) {
    1140 			throw new DAOException(e);
    1141 		}
    1142 		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 	public List readList(Object objectMappingKey, String sql,
    1151 			Object[] parameters) throws PersistenceException {
    1152 		List list;
    1153 		IGenericDao dao = null;
    1154 		try {
    1155 			dao = createDao();
    1156 			list = dao.readList(objectMappingKey, sql, parameters);
    1157 		} catch (Exception e) {
    1158 			throw new DAOException(e);
    1159 		} finally {
    1160 			JdbcUtil.close(dao);
    1161 		}
    1162 		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 	public List readList(Connection conn, Object objectMappingKey, String sql,
    1169 			Object[] parameters) throws PersistenceException, DAOException {
    1170 		List list;
    1171 		IGenericDao dao = null;
    1172 		try {
    1173 			dao = createDao(conn);
    1174 			list = dao.readList(objectMappingKey, sql, parameters);
    1175 		} catch (Exception e) {
    1176 			throw new DAOException(e);
    1177 		}
    1178 		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 	public List readList(Object objectMappingKey, String sql)
    1187 			throws PersistenceException, DAOException {
    1188 		List list;
    1189 		IGenericDao dao = null;
    1190 		try {
    1191 			dao = createDao();
    1192 			list = dao.readList(objectMappingKey, sql);
    1193 		} catch (Exception e) {
    1194 			throw new DAOException(e);
    1195 		} finally {
    1196 			JdbcUtil.close(dao);
    1197 		}
    1198 		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 	public List readList(Connection conn, Object objectMappingKey, String sql)
    1206 			throws PersistenceException, DAOException {
    1207 		List list;
    1208 		IGenericDao dao = null;
    1209 		try {
    1210 			dao = createDao(conn);
    1211 			list = dao.readList(objectMappingKey, sql);
    1212 		} catch (Exception e) {
    1213 			throw new DAOException(e);
    1214 		}
    1215 		return list;
    1216 	}
    1217
    1218 	/***
    1219 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#readListByPrimaryKeys(java.lang.Object,
    1220 	 *      java.util.Collection)
    1221 	 */
    1222 	public List readListByPrimaryKeys(Object objectMappingKey,
    1223 			Collection primaryKeys) throws PersistenceException {
    1224 		List list;
    1225 		IGenericDao dao = null;
    1226 		try {
    1227 			dao = createDao();
    1228 			list = dao.readListByPrimaryKeys(objectMappingKey, primaryKeys);
    1229 		} catch (Exception e) {
    1230 			throw new DAOException(e);
    1231 		} finally {
    1232 			JdbcUtil.close(dao);
    1233 		}
    1234 		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 	public List readListByPrimaryKeys(Connection conn, Object objectMappingKey,
    1241 			Collection primaryKeys) throws PersistenceException, DAOException {
    1242 		List list;
    1243 		IGenericDao dao = null;
    1244 		try {
    1245 			dao = createDao(conn);
    1246 			list = dao.readListByPrimaryKeys(objectMappingKey, primaryKeys);
    1247 		} catch (Exception e) {
    1248 			throw new DAOException(e);
    1249 		}
    1250 		return list;
    1251 	}
    1252
    1253 	/***
    1254 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#update(java.lang.Object,
    1255 	 *      java.lang.Object)
    1256 	 */
    1257 	public int update(Object objectMappingKey, Object object)
    1258 			throws PersistenceException {
    1259 		int nums = 0;
    1260 		IGenericDao dao = null;
    1261 		try {
    1262 			dao = createDao();
    1263 			nums = dao.update(objectMappingKey, object);
    1264 		} catch (Exception e) {
    1265 			throw new DAOException(e);
    1266 		} finally {
    1267 			JdbcUtil.close(dao);
    1268 		}
    1269 		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 	public int update(Connection conn, Object objectMappingKey, Object object)
    1276 			throws PersistenceException, DAOException {
    1277 		int nums = 0;
    1278 		IGenericDao dao = null;
    1279 		try {
    1280 			dao = createDao(conn);
    1281 			nums = dao.update(objectMappingKey, object);
    1282 		} catch (Exception e) {
    1283 			throw new DAOException(e);
    1284 		}
    1285 		return nums;
    1286 	}
    1287
    1288
    1289 	/***
    1290 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#update(java.lang.Object)
    1291 	 */
    1292 	public int update(Object object) throws PersistenceException {
    1293 		int nums = 0;
    1294 		IGenericDao dao = null;
    1295 		try {
    1296 			dao = createDao();
    1297 			nums = dao.update(object);
    1298 		} catch (Exception e) {
    1299 			throw new DAOException(e);
    1300 		} finally {
    1301 			JdbcUtil.close(dao);
    1302 		}
    1303 		return nums;
    1304 	}
    1305
    1306 	/***
    1307 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#update(java.sql.Connection, java.lang.Object)
    1308 	 */
    1309 	public int update(Connection conn, Object object)
    1310 			throws PersistenceException, DAOException {
    1311 		int nums = 0;
    1312 		IGenericDao dao = null;
    1313 		try {
    1314 			dao = createDao(conn);
    1315 			nums = dao.update(object);
    1316 		} catch (Exception e) {
    1317 			throw new DAOException(e);
    1318 		}
    1319 		return nums;
    1320 	}
    1321
    1322
    1323 	/***
    1324 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatch(java.util.Collection)
    1325 	 */
    1326 	public int[] updateBatch(Collection objects) throws PersistenceException {
    1327 		int[] nums;
    1328 		IGenericDao dao = null;
    1329 		try {
    1330 			dao = createDao();
    1331 			nums = dao.updateBatch(objects);
    1332 		} catch (Exception e) {
    1333 			throw new DAOException(e);
    1334 		} finally {
    1335 			JdbcUtil.close(dao);
    1336 		}
    1337 		return nums;
    1338 	}
    1339
    1340 	/***
    1341 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatch(java.sql.Connection, java.util.Collection)
    1342 	 */
    1343 	public int[] updateBatch(Connection conn, Collection objects)
    1344 			throws PersistenceException, DAOException {
    1345 		int[] nums;
    1346 		IGenericDao dao = null;
    1347 		try {
    1348 			dao = createDao(conn);
    1349 			nums = dao.updateBatch(objects);
    1350 		} catch (Exception e) {
    1351 			throw new DAOException(e);
    1352 		}
    1353 		return nums;
    1354 	}
    1355
    1356 	/***
    1357 	 * @see org.huihoo.jfox.soaf.services.persistence.MrPersisterService#updateBatch(java.lang.Object,
    1358 	 *      java.util.Collection)
    1359 	 */
    1360 	public int[] updateBatch(Object objectMappingKey, Collection objects)
    1361 			throws PersistenceException {
    1362 		int[] nums;
    1363 		IGenericDao dao = null;
    1364 		try {
    1365 			dao = createDao();
    1366 			nums = dao.updateBatch(objectMappingKey, objects);
    1367 		} catch (Exception e) {
    1368 			throw new DAOException(e);
    1369 		} finally {
    1370 			JdbcUtil.close(dao);
    1371 		}
    1372 		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 	public int[] updateBatch(Connection conn, Object objectMappingKey,
    1379 			Collection objects) throws PersistenceException, DAOException {
    1380 		int[] nums;
    1381 		IGenericDao dao = null;
    1382 		try {
    1383 			dao = createDao(conn);
    1384 			nums = dao.updateBatch(objectMappingKey, objects);
    1385 		} catch (Exception e) {
    1386 			throw new DAOException(e);
    1387 		}
    1388 		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 	public int[] updateBatchByPrimaryKeys(Collection objects,
    1397 			Collection oldPrimaryKeys) throws PersistenceException {
    1398 		int[] nums;
    1399 		IGenericDao dao = null;
    1400 		try {
    1401 			dao = createDao();
    1402 			nums = dao.updateBatch(objects, oldPrimaryKeys);
    1403 		} catch (Exception e) {
    1404 			throw new DAOException(e);
    1405 		} finally {
    1406 			JdbcUtil.close(dao);
    1407 		}
    1408 		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 	public int[] updateBatchByPrimaryKeys(Connection conn, Collection objects,
    1415 			Collection oldPrimaryKeys) throws PersistenceException,
    1416 			DAOException {
    1417 		int[] nums;
    1418 		IGenericDao dao = null;
    1419 		try {
    1420 			dao = createDao(conn);
    1421 			nums = dao.updateBatch(objects, oldPrimaryKeys);
    1422 		} catch (Exception e) {
    1423 			throw new DAOException(e);
    1424 		}
    1425 		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 	public int[] updateBatchByPrimaryKeys(Object objectMappingKey,
    1433 			Collection objects, Collection oldPrimaryKeys)
    1434 			throws PersistenceException {
    1435 		int[] nums;
    1436 		IGenericDao dao = null;
    1437 		try {
    1438 			dao = createDao();
    1439 			nums = dao.updateBatchByPrimaryKeys(objectMappingKey, objects, oldPrimaryKeys);
    1440 		} catch (Exception e) {
    1441 			throw new DAOException(e);
    1442 		} finally {
    1443 			JdbcUtil.close(dao);
    1444 		}
    1445 		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 	public int[] updateBatchByPrimaryKeys(Connection conn,
    1452 			Object objectMappingKey, Collection objects,
    1453 			Collection oldPrimaryKeys) throws PersistenceException,
    1454 			DAOException {
    1455 		int[] nums;
    1456 		IGenericDao dao = null;
    1457 		try {
    1458 			dao = createDao(conn);
    1459 			nums = dao.updateBatchByPrimaryKeys(objectMappingKey, objects, oldPrimaryKeys);
    1460 		} catch (Exception e) {
    1461 			throw new DAOException(e);
    1462 		}
    1463 		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 	public int updateByPrimaryKey(Object objectMappingKey, Object object,
    1472 			Object oldPrimaryKeyValue) throws PersistenceException {
    1473 		int nums = 0;
    1474 		IGenericDao dao = null;
    1475 		try {
    1476 			dao = createDao();
    1477 			nums = dao.updateByPrimaryKey(objectMappingKey,object, oldPrimaryKeyValue);
    1478 		} catch (Exception e) {
    1479 			throw new DAOException(e);
    1480 		} finally {
    1481 			JdbcUtil.close(dao);
    1482 		}
    1483 		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 	public int updateByPrimaryKey(Connection conn, Object objectMappingKey,
    1490 			Object object, Object oldPrimaryKeyValue)
    1491 			throws PersistenceException, DAOException {
    1492 		int nums = 0;
    1493 		IGenericDao dao = null;
    1494 		try {
    1495 			dao = createDao(conn);
    1496 			nums = dao.updateByPrimaryKey(objectMappingKey, object, oldPrimaryKeyValue);
    1497 		} catch (Exception e) {
    1498 			throw new DAOException(e);
    1499 		}
    1500 		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 	public int updateByPrimaryKey(Object object, Object oldPrimaryKeyValue)
    1509 			throws PersistenceException {
    1510 		int nums = 0;
    1511 		IGenericDao dao = null;
    1512 		try {
    1513 			dao = createDao();
    1514 			nums = dao.updateByPrimaryKey(object, oldPrimaryKeyValue);
    1515 		} catch (Exception e) {
    1516 			throw new DAOException(e);
    1517 		} finally {
    1518 			JdbcUtil.close(dao);
    1519 		}
    1520 		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 	public int updateByPrimaryKey(Connection conn, Object object,
    1527 			Object oldPrimaryKeyValue) throws PersistenceException,
    1528 			DAOException {
    1529 		int nums = 0;
    1530 		IGenericDao dao = null;
    1531 		try {
    1532 			dao = createDao(conn);
    1533 			nums = dao.updateByPrimaryKey(object, oldPrimaryKeyValue);
    1534 		} catch (Exception e) {
    1535 			throw new DAOException(e);
    1536 		}
    1537 		return nums;
    1538 	}
    1539 }