我尝试在 IntelliJ IDEA 上使用 JDO2 创建一个新的 GAE/J 项目,但由于以下 org.datanucleus.jdo.exceptions.ClassNotPersistenceCapableException,它无法正常工作:
The class "Book" is not persistable. This means that it either hasnt been enhanced, or that the enhanced version of the file is not in the CLASSPATH (or is hidden by an unenhanced version), or the Meta-Data/annotations for the class are not found." is not persistable. This means that it either hasnt been enhanced, or that the enhanced version of the file is not in the CLASSPATH (or is hidden by an unenhanced version), or the Meta-Data for the class is not found.
我还尝试在 Eclipse 上创建完全相同的项目,它运行良好,没有任何问题。创建的模型很简单如下(我认为这个模型是无关的):
@PersistenceCapable
public class Book {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
private String name;
public Book(String name) {
this.name = name;
}
}
谢谢。