【发布时间】:2014-12-23 09:54:17
【问题描述】:
我有一个存储库类,其方法如下:
@Transactional
@Modifying(clearAutomatically = true)
@Query("update Form f set f.xmlWithData =:xmlWithData where f.id =:id")
void save(@Param("xmlWithData") String xmlWithData, @Param("id") longid);
这个方法之后的建议如下:
@After("execution(* tr.com.blabla.FormRepository.save(*,*)) && args(xmlWithData,id)")
public void generateFormData(String xmlWithData, long id) throws Exception {
}
我的问题是:
是否可以在我的建议方法中使用 Form f 对象,如下所示:
@After("execution(* tr.com.blabla.FormRepository.save(*,*)) && args(xmlWithData,id)")
public void generateFormData(String xmlWithData, long id) throws Exception{
if(f.getSomething().equals("blabla") {
this.doSomething();
}
}
提前谢谢...
【问题讨论】:
-
请对代码块使用缩进而不是三个反引号。有关于格式化的在线帮助,顺便说一句。 :-)
标签: spring spring-data-jpa aspectj