小编Anc*_*a N的帖子

在使用加载时间编织时未编织的超级类中的@Transactional

我正在研究的项目与DAOs下面的项目有类似的结构:

/** 
* Base DAO class
*/
@Transactional    
public class JPABase {

  @PersistenceContext
  private EntityManager entityManager;

  public void persist(Object entity) {
    entityManager.persist(entity);
  }
 //some more methods in here
}
Run Code Online (Sandbox Code Playgroud)

/** 
* Generic DAO class implementation
*/
@Transactional 
public abstract class GenericDao extends JpaBase {
   //some methods in here
}
Run Code Online (Sandbox Code Playgroud)

/** 
* Specialized DAO class
*/
@Repository
@Transactional
public class PersonDao extends GenericDao {
  //some methods in here
}
Run Code Online (Sandbox Code Playgroud)

到现在为止,该项目使用的编译时编织,但而配置也改为使用<context:load-time-weaver/>-javaagent:/opt/tomcat7-1/lib/spring-instrument.jar.

由于已经应用了这种改变,因此不再编织JpaBase's和 …

java spring aspectj compile-time-weaving load-time-weaving

38
推荐指数
1
解决办法
1395
查看次数