相关疑难解决方法(0)

我应该在哪里放置@Transactional注释:在接口定义或实现类?

代码中标题的问题:

@Transactional (readonly = true)
public interface FooService {
   void doSmth ();
}


public class FooServiceImpl implements FooService {
   ...
}
Run Code Online (Sandbox Code Playgroud)

VS

public interface FooService {
   void doSmth ();
}

@Transactional (readonly = true)
public class FooServiceImpl implements FooService {
   ...
}
Run Code Online (Sandbox Code Playgroud)

java spring annotations coding-style

82
推荐指数
3
解决办法
3万
查看次数

标签 统计

annotations ×1

coding-style ×1

java ×1

spring ×1