【发布时间】:2013-05-14 13:25:35
【问题描述】:
晚上好,
我是 Java Persistence API 的新手,我想测试一下阿里巴巴,看看它能做什么。 AliBaba website。我读了the exemple given here 的一部分。我有整个阿里巴巴项目和两个示例文件,我对示例进行了一些修改。
//Document.java
package org.openrdf.example;
import org.openrdf.annotations.Iri;
@Iri(Document.NS + "Document")
public class Document {
public static final String NS = "http://meta.leighnet.ca/rdf/2009/gs#";
@Iri(NS + "title") String title;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
还有我的其他文件:
//my Main with many imports
public class Main {
public static void main(String[] args) throws java.lang.IllegalAccessException {
// create a Document
Document doc = new Document();
// give it a title
doc.setTitle("Getting Started");
System.out.println("Title of the new document: "+doc.getTitle());
// add a Document to the repository
ObjectConnection con = repository.getConnection();
// the problem is here
我的问题出在这一行:
ObjectConnection con = repository.getConnection();
我没有“存储库”的声明。 但对象类型出现错误。
感谢您的帮助,我希望我的文字可以理解,因为这是我在这里的第一篇文章。
【问题讨论】:
-
用户文档在他们的网站上:link
-
谢谢你提供这个链接,我不知道我怎么没看到它。很有帮助。