社区
高性能WEB开发
帖子详情
求aspectj 事务处理例子和代码
ccdxjjxy
2009-04-11 10:34:12
求aspectj 事务处理例子和代码
...全文
129
3
打赏
收藏
求aspectj 事务处理例子和代码
求aspectj 事务处理例子和代码
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
matrixjava
2009-05-27
打赏
举报
回复
配置实现:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy/>
<bean id="judgeInterceptor" class="cc.lotes.mms.common.interceptor.JudgeInterceptor">
<property name="judgeDao" ref="judgeDao"/>
<property name="inEntrepotDao" ref="inEntrepotDao"/>
<property name="judgePeriodicityDao" ref="judgePeriodicityDao"/>
<property name="noService" ref="noService"/>
</bean>
</beans>
java程序实现:
/*
* 新增出库单时失效入库单时
*/
@Pointcut("execution (* cc.lotes.mms.am.service.InEntrepotService.invalidInEntrepot(..))")
public void invalidInEntrepotMethod() {}//声明一个切入点
@After( "invalidInEntrepotMethod()&& args(inEntrepot)")
public void delJudge(InEntrepot inEntrepot){
Judge judge = this.judgeDao.findJudgeByInEntrepotId(inEntrepot.getInEntrepotNo());
if(judge!=null){
judge.setVaild("N");
this.judgeDao.modJudge(judge);
}
}
ccdxjjxy
2009-04-24
打赏
举报
回复
怎么没有人回复呢
ccdxjjxy
2009-04-11
打赏
举报
回复
最好是Aspect5的例子
AspectJ
面向切面的
例子
面向切面,
AspectJ
,是一个
AspectJ
官方提供的用面向切面方法编写的星际战争小游戏,动作非常逼真!
aspectj
用的的jar包
面向切面编程必不可少的。可以帮助你完成在Hibernate中用annotation完成面向切面的编程。
Spring @
AspectJ
实现AOP 入门
例子
NULL 博文链接:https://samter.iteye.com/blog/410618
AspectJ
经典实例详解
AspectJ
经典实例 用例简单明了,适合初学者!~希望大家能多多交流!~
book :
aspectj
in action
博文链接:https://nlslzf.iteye.com/blog/239367
高性能WEB开发
25,980
社区成员
4,366
社区内容
发帖
与我相关
我的任务
高性能WEB开发
高性能WEB开发
复制链接
扫一扫
分享
社区描述
高性能WEB开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章