我无法使用 Tinkerpop 框架和蓝图(2.6 版)保留新顶点。我究竟做错了什么?这是我的代码..从无用的部分中清理了一些。我正在使用 OrientDb 作为 undelying Graph 数据库引擎。
我没有收到任何例外,但是当我查看数据库时,它是空的。你能注意到为什么吗?谢谢!
框架实体:
public interface User extends VertexFrame{
@Property("id")
public String getId();
@Property("id")
public void getId(String Id);
@Property("email")
public String getEmail();
@Property("email")
public void setEmail(String email);
@Property("password")
public String getPassword();
@Property("password")
public void getPassword(String providerId);
@Property("firstName")
public String getFirstName();
@Property("firstName")
public void setFirstName(String firstName);
}
用户管理器类:
public class UserManager implements Serializable {
FramedGraphFactory framedFactory = new FramedGraphFactory();
OrientGraphFactory graphFactory = new OrientGraphFactory("remote:192.168.50.10:2424/database", "user", "pass");
OrientGraph instance = graphFactory.getTx();
FramedGraph<OrientGraph> framedGraph = framedFactory.create(instance);
User user = framedGraph.addVertex(UUID.randomUUID(), User.class);
user.setFirstName(profile.getFirstName());
user.setLastName(profile.getLastName());
OrientVertex u = (OrientVertex) user.asVertex();
u.save();
}