问题描述
我有一个旧的 appfuse 项目,运行 Spring 2.0 和 Java 1.6,我正在尝试运行事务注释支持(和其他注释).
I have an old appfuse project, running Spring 2.0, and Java 1.6, and I'm trying to get Transaction annotation support (and other annotations) running.
但是,当我将其添加到我们的班级时:
But, when I add this to our class:
@Transactional
public class ... {
}
我们遇到了一个 ant 编译问题,例如:
We get an ant compile issue, like:
[javac] symbol: class Transactional
[javac] @Transactional
[javac] ^
如何告诉 ant 它应该使用哪些 Spring 事务?
How do I tell ant which Spring transactions it should be using?
推荐答案
这在我看来是一个简单的导入问题.您是否导入了 org.springframework.transaction.annotation.Transactional
:
This looks like a simple import problem to me. Have you imported the class org.springframework.transaction.annotation.Transactional
:
import org.springframework.transaction.annotation.Transactional
注解是必须导入才能使用的类(不使用它们的完全限定名称),就像任何其他类一样.
Annotations are classes which must be imported to be used (without using their fully qualified name), just as any other class.
这篇关于Spring 2.0 注释和蚂蚁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!