如何使类具有持久性能力

时间:2016-09-07 09:41:46

标签: java hibernate maven jdo

我正在尝试创建一个类,其代码片段如下:

import java.io.Serializable;
import java.util.Date;
import com.objy.db.app.ooObj;


import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

@PersistenceCapable
public class Student extends ooObj implements Serializable {
...
}

现在,该程序甚至没有编译,因为它说t无法识别ooObj类,如果没有这个,记录器将返回以下内容:

org.datanucleus.exceptions.ClassNotPersistableException: The class "project2.Student" 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.]]

有人可以建议如何使类持久化或使用某种maven依赖来使用ooObj。

1 个答案:

答案 0 :(得分:0)

Google搜索" com.objy.db.app.ooObj"并尝试自己找到遗漏的依赖!

我想你需要下载Objectivity / DB for Java:http://support.objectivity.com/downloads