public void testSqlMapClientDaoSupport() throws Exception {
    MockControl dsControl = MockControl.createControl(DataSource.class);
    DataSource ds = (DataSource) dsControl.getMock();
    SqlMapClientDaoSupport testDao = new SqlMapClientDaoSupport() {};
    testDao.setDataSource(ds);
    assertEquals(ds, testDao.getDataSource());

    MockControl clientControl = MockControl.createControl(SqlMapClient.class);
    SqlMapClient client = (SqlMapClient) clientControl.getMock();
    clientControl.replay();

    testDao.setSqlMapClient(client);
    assertEquals(client, testDao.getSqlMapClient());

    SqlMapClientTemplate template = new SqlMapClientTemplate();
    template.setDataSource(ds);
    template.setSqlMapClient(client);
    testDao.setSqlMapClientTemplate(template);
    assertEquals(template, testDao.getSqlMapClientTemplate());

    testDao.afterPropertiesSet();
  }
示例#2
0
 @Autowired
 public void setSqlMapClientBase(SqlMapClient sqlMapClient) {
   super.setSqlMapClient(sqlMapClient);
 }
示例#3
0
 @PostConstruct
 public void initSqlMapClient() {
   super.setSqlMapClient(sqlMapClient);
 }
示例#4
0
 @Autowired
 public CommunicationDao(@Qualifier("sqlMapClient") SqlMapClient sqlMapClient) {
   super();
   super.setSqlMapClient(sqlMapClient);
 }
 @Resource
 public void setSqlMapClientForAutowire(SqlMapClient sqlMapClient) {
   super.setSqlMapClient(sqlMapClient);
 }
示例#6
0
 @Autowired(required = false)
 public void setSuperSqlMapClient(SqlMapClient sqlMapClient) {
   super.setSqlMapClient(sqlMapClient);
 }
示例#7
0
 @Autowired
 public void setIbatisClient(SqlMapClient client) {
   super.setSqlMapClient(client);
 }
示例#8
0
 /**
  * 更新一条半年报记录
  *
  * @author William
  * @param Halfyear
  */
 @Override
 public void uHalfyearRec(Halfyear aHalfyearRec) {
   super.getSqlMapClientTemplate().update("datereportseason.uHalfyearRec", aHalfyearRec);
 }
示例#9
0
 /**
  * 新增一条半年报记录
  *
  * @author William
  * @param Halfyear
  */
 @Override
 public void iHalfyearRec(Halfyear aHalfyearRec) {
   super.getSqlMapClientTemplate().insert("datereportseason.iHalfyearRec", aHalfyearRec);
 }