protected OrientEdge getEdgeInstance(final OIdentifiable from, final OIdentifiable to, final String label) { return new OrientEdge(this, from, to, label); }
protected OrientEdge getEdgeInstance(final OIdentifiable id) { return new OrientEdge(this, id); }
protected OrientEdge getEdgeInstance(final String className, final Object... fields) { return new OrientEdge(this, className, fields); }
return (OrientEdge) id; else if (id instanceof ODocument) return new OrientEdge(this, (OIdentifiable) id); return new OrientEdge(this, new ORecordId(from), new ORecordId( to)); return null; return new OrientEdge(this, rec);
toAdd = new OrientEdge(graph, doc, fieldRecord, connection.getValue()); else toAdd = new OrientEdge(graph, fieldRecord, doc, connection.getValue()); OrientEdge.CLASS_NAME)) { toAdd = new OrientEdge(graph, fieldRecord); } else throw new IllegalStateException("Invalid content found in "
return (OrientEdge) id; else if (id instanceof ODocument) return new OrientEdge(this, (OIdentifiable) id); return new OrientEdge(this, rec);
@SuppressWarnings("unchecked") public T next() { OrientElement currentElement = null; if (!hasNext()) throw new NoSuchElementException(); Object current = itty.next(); if (null == current) throw new NoSuchElementException(); if (current instanceof OIdentifiable) current = ((OIdentifiable) current).getRecord(); if (current instanceof ODocument) { final ODocument currentDocument = (ODocument) current; if (currentDocument.getInternalStatus() == ODocument.STATUS.NOT_LOADED) currentDocument.load(); if (currentDocument.getSchemaClass() == null) throw new IllegalArgumentException( "Cannot determine the graph element type because the document class is null. Probably this is a projection, use the EXPAND() function"); if (currentDocument.getSchemaClass().isSubClassOf(graph.getEdgeBaseType())) currentElement = new OrientEdge(graph, currentDocument); else currentElement = new OrientVertex(graph, currentDocument); } return (T) currentElement; }
@Override public OrientEdge createWrapper(final Object iObject) { if (iObject instanceof OrientEdge) return (OrientEdge) iObject; final OIdentifiable rec = (OIdentifiable) iObject; final ODocument value = rec.getRecord(); if (value == null || value.getSchemaClass() == null) return null; final OrientEdge edge; if (value.getSchemaClass().isSubClassOf(OrientVertex.CLASS_NAME)) { // DIRECT VERTEX, CREATE DUMMY EDGE if (connection.getKey() == Direction.OUT) edge = new OrientEdge(this.vertex.graph, this.vertex.getIdentity(), rec.getIdentity(), connection.getValue()); else edge = new OrientEdge(this.vertex.graph, rec.getIdentity(), this.vertex.getIdentity(), connection.getValue()); } else if (value.getSchemaClass().isSubClassOf(OrientEdge.CLASS_NAME)) { // EDGE edge = new OrientEdge(this.vertex.graph, rec.getIdentity()); } else throw new IllegalStateException("Invalid content found between connections:" + value); if (this.vertex.graph.isUseVertexFieldsForEdgeLabels() || edge.isLabeled(labels)) return edge; return null; }
new OrientEdge(graph, iFromVertex, iToVertex, label) .convertToDocument(); return false; new OrientEdge(graph, iFromVertex, iToVertex, label) .convertToDocument(); return false; new OrientEdge(graph, iFromVertex, iToVertex, label) .convertToDocument(); return false; new OrientEdge(graph, iFromVertex, iToVertex, label) .convertToDocument(); return false;
return new OrientVertex(this, doc); } else if (schemaClass.isSubClassOf(OrientEdge.CLASS_NAME)) { return new OrientEdge(this, doc); } else throw new IllegalArgumentException("Type error. The class "
public Object next() { OrientElement currentElement = null; if (!hasNext()) throw new NoSuchElementException(); Object current = itty.next(); if (null == current) throw new NoSuchElementException(); if (current instanceof OIdentifiable) current = ((OIdentifiable) current).getRecord(); if (current instanceof ODocument) { final ODocument currentDocument = (ODocument) current; if (currentDocument.getInternalStatus() == ODocument.STATUS.NOT_LOADED) currentDocument.load(); if (currentDocument.getSchemaClass() == null) return currentDocument; if (currentDocument.getSchemaClass().isSubClassOf(graph.getVertexBaseType())) currentElement = new OrientVertex(graph, currentDocument); else if (currentDocument.getSchemaClass().isSubClassOf(graph.getEdgeBaseType())) currentElement = new OrientEdge(graph, currentDocument); else return currentDocument; } return currentElement; }
edge = new OrientEdge(graph, from, to, label); } else { edge = new OrientEdge(graph, label, fields);
} else if (immutableSchema.isEdgeType()) { edge = new OrientEdge(this.sourceVertex.getGraph(), rec.getIdentity(), connection.getValue()); } else throw new IllegalStateException("Invalid content found while iterating edges, value '" + value + "' is not an edge");