本文整理汇总了Java中org.neo4j.graphdb.Relationship.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Relationship.getId方法的具体用法?Java Relationship.getId怎么用?Java Relationship.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.neo4j.graphdb.Relationship
的用法示例。
在下文中一共展示了Relationship.getId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRelationship
import org.neo4j.graphdb.Relationship; //导入方法依赖的package包/类
/**
*
* @param properties
* @param labels
* @return
*/
public static long createRelationship(long startNodeId, long endNodeId, RelationshipType relationshipType, Map<String, Object> properties)
{
GraphDatabaseService graphDatabaseService = getGraphDatabaseService();
Node startNode = graphDatabaseService.getNodeById(startNodeId);
Node endNode = graphDatabaseService.getNodeById(endNodeId);
Relationship relationship = startNode.createRelationshipTo(endNode, relationshipType);
for (String key : properties.keySet())
{
relationship.setProperty(key, properties.get(key));
}
return relationship.getId();
}
示例2: Neo4jRelationship
import org.neo4j.graphdb.Relationship; //导入方法依赖的package包/类
public Neo4jRelationship(final Relationship rel) {
this(rel.getId(), rel.getType().name(),
Maps.asMap(ImmutableSet.copyOf(rel.getPropertyKeys()), k -> rel.getProperty(k)));
}
示例3: Neo4JEdge
import org.neo4j.graphdb.Relationship; //导入方法依赖的package包/类
public Neo4JEdge(Relationship r, Neo4JDatabase graph) {
id = r.getId();
rel = r;
this.graph = graph;
}