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