@Override void removeEdgesInternal(OrientVertex vertex, ODocument iVertex, OIdentifiable iVertexToRemove, boolean iAlsoInverse, boolean useVertexFieldsForEdgeLabels, boolean autoScaleEdgeType) { for (String fieldName : iVertex.fieldNames()) { final OPair<Direction, String> connection = vertex.getConnection(Direction.BOTH, fieldName); if (connection == null) // SKIP THIS FIELD continue; removeEdges(this, iVertex, fieldName, iVertexToRemove, iAlsoInverse, useVertexFieldsForEdgeLabels, autoScaleEdgeType, false); } } }
public long countEdges(final Direction iDirection, final String... iLabels) { long counter = 0; if (graph.isUseVertexFieldsForEdgeLabels() || iLabels == null || iLabels.length == 0) { // VERY FAST final ODocument doc = getRecord(); for (String fieldName : doc.fieldNames()) { final OPair<Direction, String> connection = getConnection( iDirection, fieldName, iLabels); if (connection == null) // SKIP THIS FIELD continue; final Object fieldValue = doc.field(fieldName); if (fieldValue != null) if (fieldValue instanceof Collection<?>) counter += ((Collection<?>) fieldValue).size(); else if (fieldValue instanceof Map<?, ?>) counter += ((Map<?, ?>) fieldValue).size(); else counter++; } } else { // SLOWER: BROWSE & FILTER for (Edge e : getEdges(iDirection, iLabels)) if (e != null) counter++; } return counter; }
final OPair<Direction, String> connection = getConnection( Direction.BOTH, fieldName); if (connection == null)
final OPair<Direction, String> connection = getConnection(Direction.BOTH, fieldName); if (connection == null)
if (iClassNames == null || iClassNames.length == 0 || (iClassNames.length == 1 && iClassNames[0].equalsIgnoreCase("E"))) { for (String fieldName : doc.fieldNames()) { final OPair<Direction, String> connection = getConnection(iDirection, fieldName, iClassNames); if (connection != null) result.add(new OTriple<String, Direction, String>(fieldName, connection.getKey(), connection.getValue()));
.setEmbedded(true); for (String fieldName : doc.fieldNames()) { final OPair<Direction, String> connection = getConnection( iDirection, fieldName, iLabels); if (connection == null)
final OPair<Direction, String> connection = getConnection( iDirection, fieldName, iLabels); if (connection == null)
@Override void removeEdgesInternal(final OrientVertex vertex, final ODocument iVertex, final OIdentifiable iVertexToRemove, final boolean iAlsoInverse, final boolean useVertexFieldsForEdgeLabels, final boolean autoScaleEdgeType) { Exception lastException = null; boolean forceReload = false; final int maxRetries = getMaxRetries(); for (int retry = 0; retry < maxRetries; ++retry) { try { for (String fieldName : iVertex.fieldNames()) { final OPair<Direction, String> connection = vertex.getConnection(Direction.BOTH, fieldName); if (connection == null) // SKIP THIS FIELD continue; removeEdges(this, iVertex, fieldName, iVertexToRemove, iAlsoInverse, useVertexFieldsForEdgeLabels, autoScaleEdgeType, forceReload); } // OK return; } catch (Exception e) { forceReload = true; lastException = e; } } if (lastException instanceof RuntimeException) // CANNOT REVERT CHANGES, RETRY throw (RuntimeException) lastException; throw OException.wrapException(new OrientGraphModificationException( "Error on removing edges after vertex (" + iVertex.getIdentity() + ") delete in non tx environment"), lastException); }
final OPair<Direction, String> connection = getConnection(iDirection, fieldName, iLabels); if (connection == null)
final OPair<Direction, String> connection = v.getConnection(Direction.BOTH, fieldName, null); if (connection == null)