首页>代码>基于spring转账Demo,基于xml AOP配置>/com.yyc.spring_transfer_xml/src/main/java/com/yyc/service/impl/AccountServiceImpl.java
package com.yyc.service.impl;

import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
import org.springframework.transaction.support.TransactionTemplate;

import com.yyc.dao.AccountDao;
import com.yyc.service.AccountService;

public class AccountServiceImpl implements AccountService {

	private AccountDao accountDao;
	public void setAccountDao(AccountDao accountDao) {
		this.accountDao = accountDao;
	}
	
	public void transfer(String payee, String payer, Integer money) {
		
				accountDao.payee(payee, money);
				//模拟转账出错的情况
				//int i = 1/0;
				accountDao.payer(payer, money);
			
	}

}
最近下载更多
xjllllllzgj  LV3 2020年7月13日
cz206616  LV10 2020年6月12日
1358849392  LV21 2019年11月15日
sycamo  LV2 2018年12月23日
wsfdwr  LV10 2018年3月16日
miaozhou  LV2 2018年3月5日
ly292208586  LV8 2018年1月30日
wangwenyi  LV6 2018年1月25日
最近浏览更多
toparitly  LV1 2023年6月18日
2517786374  LV4 2023年4月23日
yongjava21  LV26 2022年9月29日
IT达人  LV22 2022年5月17日
lyws1986  LV17 2021年12月16日
秦sir3067683450  LV10 2021年6月2日
sizeking  LV8 2021年4月12日
IT白夜  LV12 2020年12月16日
破壳鸡蛋  LV5 2020年11月20日
13043860zj  LV16 2020年9月3日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友