业务逻辑层JDBC模板代码(使用Manager代理类,具有控制事务和管理connection功能)

private FlowCardDao flowCardDao;

	public FlowCardManagerImpl() {
		super();
		this.flowCardDao = (FlowCardDao) BeanFactory.getInstance().getDaoObject(FlowCardDao.class);
	}



	@Override
	public void addFlowCard(FlowCardMaster flowCardMaster)
			throws ApplicationException {
		
		try {
			// 调用Dao层方法,添加流向单
                        String flowCardNO = flowCardDao.generateVouNO();
			flowCardDao.addFlowCardMaster(flowCardNO, flowCardMaster);
			flowCardDao.addFlowCardDetail(flowCardNO,
					flowCardMaster.getFlowCardDetails());
		
                        // Dao层的方法可能会抛出DaoException
                    } catch (DaoException e) {
			throw new ApplicationException("添加流向单失败!");
			
		} 
	}


 

阅读更多
文章标签: manager jdbc dao string
个人分类: Manager
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭