本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedGraph类的典型用法代码示例。如果您正苦于以下问题:Java WrappedGraph类的具体用法?Java WrappedGraph怎么用?Java WrappedGraph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WrappedGraph类属于org.apache.tinkerpop.gremlin.structure.util.wrapped包,在下文中一共展示了WrappedGraph类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setProperty
import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedGraph; //导入依赖的package包/类
@Override
public <V> Property<V> setProperty(final Neo4jVertexProperty vertexProperty, final String key, final V value) {
final Neo4jNode vertexPropertyNode = Neo4jHelper.getVertexPropertyNode(vertexProperty);
if (null != vertexPropertyNode) {
vertexPropertyNode.setProperty(key, value);
return new Neo4jProperty<>(vertexProperty, key, value);
} else {
final Neo4jNode vertexNode = ((Neo4jVertex) vertexProperty.element()).getBaseVertex();
final Neo4jNode newVertexPropertyNode = ((WrappedGraph<Neo4jGraphAPI>) vertexProperty.element().graph()).getBaseGraph().createNode(VERTEX_PROPERTY_LABEL, vertexProperty.label());
newVertexPropertyNode.setProperty(T.key.getAccessor(), vertexProperty.key());
newVertexPropertyNode.setProperty(T.value.getAccessor(), vertexProperty.value());
newVertexPropertyNode.setProperty(vertexProperty.key(), vertexProperty.value());
newVertexPropertyNode.setProperty(key, value);
vertexNode.connectTo(newVertexPropertyNode, Graph.Hidden.hide(vertexProperty.key()));
vertexNode.setProperty(vertexProperty.key(), VERTEX_PROPERTY_TOKEN);
Neo4jHelper.setVertexPropertyNode(vertexProperty, newVertexPropertyNode);
return new Neo4jProperty<>(vertexProperty, key, value);
}
}
示例2: clear
import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedGraph; //导入依赖的package包/类
@Override
public void clear(Graph g, final Configuration configuration) throws Exception {
if (null != g) {
while (g instanceof WrappedGraph) g = ((WrappedGraph<? extends Graph>) g).getBaseGraph();
TitanGraph graph = (TitanGraph) g;
if (graph.isOpen()) {
if (g.tx().isOpen()) g.tx().rollback();
g.close();
}
}
WriteConfiguration config = new CommonsConfiguration(configuration);
BasicConfiguration readConfig = new BasicConfiguration(GraphDatabaseConfiguration.ROOT_NS, config, BasicConfiguration.Restriction.NONE);
if (readConfig.has(GraphDatabaseConfiguration.STORAGE_BACKEND)) {
TitanGraphBaseTest.clearGraph(config);
}
}
示例3: testGetGraph
import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedGraph; //导入依赖的package包/类
@Test
public void testGetGraph() {
WrappedGraph actualDelegate = delegatingTx.getGraph();
Mockito.verifyZeroInteractions(gremlinTx, framedGraph);
Assert.assertEquals(framedGraph, actualDelegate);
}