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