|
|||||||||||||||||||
| 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 | |||||||||||||||
| IbatisServiceImpl.java | - | 83.3% | 100% | 87.5% |
|
||||||||||||||
| 1 |
/**
|
|
| 2 |
* JFoxSOAF, Service-Oriented Application Framework
|
|
| 3 |
*
|
|
| 4 |
* Copyright (C) www.huihoo.org
|
|
| 5 |
*
|
|
| 6 |
* Distributable under GNU LGPL
|
|
| 7 |
*
|
|
| 8 |
* For more information, please visit: http://www.huihoo.org/jfox/jfoxsoaf
|
|
| 9 |
*/
|
|
| 10 |
|
|
| 11 |
package org.huihoo.jfox.soaf.services.persistence;
|
|
| 12 |
|
|
| 13 |
import java.io.Reader;
|
|
| 14 |
|
|
| 15 |
import org.huihoo.jfox.soaf.exception.IbatisConfigurationException;
|
|
| 16 |
|
|
| 17 |
import com.ibatis.common.resources.Resources;
|
|
| 18 |
import com.ibatis.dao.client.DaoManager;
|
|
| 19 |
import com.ibatis.dao.client.DaoManagerBuilder;
|
|
| 20 |
|
|
| 21 |
/**
|
|
| 22 |
* <p>
|
|
| 23 |
* Ibatis persistence service wrapper.
|
|
| 24 |
* </p>
|
|
| 25 |
*
|
|
| 26 |
* @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
|
|
| 27 |
* @version $Revision: 1.2 $ $Date: 2004/11/16 07:58:12 $
|
|
| 28 |
* @version Revision: 1.0
|
|
| 29 |
*/
|
|
| 30 |
|
|
| 31 |
public class IbatisServiceImpl implements IbatisService { |
|
| 32 |
|
|
| 33 |
private DaoManager daoManager;
|
|
| 34 |
|
|
| 35 |
/**
|
|
| 36 |
* Defalut Constructor.
|
|
| 37 |
*/
|
|
| 38 | 2 |
public IbatisServiceImpl() {
|
| 39 | 2 |
try {
|
| 40 | 2 |
String resource = "ibatis-dao.xml";
|
| 41 | 2 |
Reader reader = Resources.getResourceAsReader(resource); |
| 42 | 2 |
daoManager = DaoManagerBuilder.buildDaoManager(reader); |
| 43 |
} catch (Exception e) {
|
|
| 44 | 0 |
throw new IbatisConfigurationException( |
| 45 |
"Could not initialize Ibatis DaoConfig. Cause: " + e);
|
|
| 46 |
} |
|
| 47 |
} |
|
| 48 |
|
|
| 49 |
/**
|
|
| 50 |
* @see org.huihoo.jfox.soaf.services.persistence.IbatisService#getDaoManager()
|
|
| 51 |
*/
|
|
| 52 | 1 |
public DaoManager getDaoManager() {
|
| 53 | 1 |
return this.daoManager; |
| 54 |
} |
|
| 55 |
|
|
| 56 |
} |
|
||||||||||