/** * (Blueprints Extension) Returns the class name based on graph settings. */ public String getClassName(final String iLabel) { if (iLabel != null && (settings == null || settings.isUseClassForEdgeLabel())) // USE THE LABEL AS DOCUMENT CLASS return checkForClassInSchema(iLabel); return OrientEdgeType.CLASS_NAME; }
@Override public <T> T getProperty(final String key) { graph.setCurrentGraphInThreadLocal(); if (rawElement == null) // LIGHTWEIGHT EDGE return null; return super.getProperty(key); }
protected OrientTransactionalGraph(final ODatabaseDocumentInternal iDatabase, final String iUserName, final String iUserPasswd, final Settings iConfiguration) { super(iDatabase, iUserName, iUserPasswd, iConfiguration); setCurrentGraphInThreadLocal(); super.setAutoStartTx(isAutoStartTx()); if (isAutoStartTx()) ensureTransaction(); }
@Override public void initCommunityProperty() { int communityCounter = 0; for (Vertex v : graph.getVertices()) { ((OrientVertex) v).setProperties(NODE_COMMUNITY, communityCounter, COMMUNITY, communityCounter); ((OrientVertex) v).save(); communityCounter++; } }
public OrientVertex addVertex(final String iClassName, final String iClusterName) { this.autoStartTransaction(); final OrientVertex vertex = new OrientVertex(this, iClassName); // SAVE IT if (iClusterName != null) vertex.save(iClusterName); else vertex.save(); return vertex; }
@Override public void setProperty(final String key, final Object value) { graph.setCurrentGraphInThreadLocal(); if (rawElement == null) // LIGHTWEIGHT EDGE convertToDocument(); super.setProperty(key, value); }
@Override public OrientVertexProperty call(OrientBaseGraph iArgument) { final String clsName = OrientBaseGraph.encodeClassName(iEdgeClassName); final boolean useVertexFieldsForEdgeLabels = graph.isUseVertexFieldsForEdgeLabels(); final String fieldName = OrientVertex.getConnectionFieldName(iDirection, clsName, useVertexFieldsForEdgeLabels); return new OrientVertexProperty(graph, delegate.createProperty(fieldName, iType)); } });
protected void addSingleEdge(final ODocument doc, final OMultiCollectionIterator<Edge> iterable, String fieldName, final OPair<Direction, String> connection, final Object fieldValue, final OIdentifiable iTargetVertex, final String[] iLabels) { final OrientBaseGraph graph = getGraph(); final OrientEdge toAdd = getEdge(graph, doc, fieldName, connection, fieldValue, iTargetVertex, iLabels); if (toAdd != null && (settings.isUseVertexFieldsForEdgeLabels() || toAdd.isLabeled(iLabels))) // ADD THE EDGE iterable.add(toAdd); }
/** * Returns a GraphQuery object to execute queries against the Graph. * * @return new GraphQuery instance */ @Override public GraphQuery query() { makeActive(); return new OrientGraphQuery(this); }
public String getClassName(final String iLabel) { if (iLabel != null && graph.isUseClassForEdgeLabel()) // USE THE LABEL AS DOCUMENT CLASS return checkForClassInSchema(iLabel); return CLASS_NAME; }
@Override public OrientVertexQuery query() { graph.setCurrentGraphInThreadLocal(); return new OrientVertexQuery(this); }
/** * Executes a query against the current vertex. The returning type is a OrientVertexQuery. */ @Override public OrientVertexQuery query() { setCurrentGraphInThreadLocal(); return new OrientVertexQuery(this); }
protected OrientBaseGraph setCurrentGraphInThreadLocal() { final OrientBaseGraph graph = getGraph(); if (graph != null) graph.setCurrentGraphInThreadLocal(); return graph; }
/** * Returns the E persistent class as OrientEdgeType instance. */ public OrientEdgeType getEdgeBaseType() { makeActive(); return new OrientEdgeType(this); }
protected OrientTransactionalGraph(final ODatabaseDocumentInternal iDatabase, final boolean iAutoStartTx, final String iUserName, final String iUserPasswd) { super(iDatabase, iUserName, iUserPasswd, null); setCurrentGraphInThreadLocal(); super.setAutoStartTx(iAutoStartTx); if (iAutoStartTx) ensureTransaction(); }
public Iterable<Vertex> getVerticesOfClass(final String iClassName, final boolean iPolymorphic) { getContext(true); return new OrientElementScanIterable<Vertex>(this, iClassName, iPolymorphic); }
@Override public Iterator<Vertex> iterator() { return new OrientClassVertexIterator(super.graph, super.iterator(), klass); }
public OrientTransactionalGraph setUseLog(final boolean useLog) { makeActive(); settings.setUseLog(useLog); return this; }
public boolean isUseLog() { makeActive(); return settings.isUseLog(); }
@Override public OrientVertexType getSuperClass() { return new OrientVertexType(graph, super.getSuperClass()); }