3
我有几个使用@Transactional
注释的公共方法,IntelliJ显示了它们可以是包私有或私有的警告。@Transactional方法禁用警告“访问可以是包私有”
@Transactional
public void doSomething() {
///body
}
由于与@Transactional
注释应该是公开的方法,我怎么可以禁用这个的IntelliJ检查/只适用于那些方法警告?
如果您在代理模式下使用Spring(默认),“@ Transactional”仅适用于通过接口访问的方法,并且由于实现接口的方法必须是“public”,所以会阻止该警告。 – Andreas