Skip to content

Commit

Permalink
added support to DELETE EDGE [rid1, ridN] (multiple RIDs as a target …
Browse files Browse the repository at this point in the history
…for delete edge)
  • Loading branch information
luigidellaquila committed Mar 9, 2015
1 parent 5e964ae commit 6d99108
Show file tree
Hide file tree
Showing 4 changed files with 1,573 additions and 1,459 deletions.
21 changes: 20 additions & 1 deletion core/src/main/grammar/OrientSQL.jjt
Expand Up @@ -664,7 +664,26 @@ ODeleteEdgeStatement DeleteEdgeByRidStatement():
(
<DELETE>
<EDGE>
jjtThis.rid = Rid()
(
jjtThis.rid = Rid()
|
(

<LBRACKET>
[
lastRid = Rid()
{
jjtThis.rids = new ArrayList();
jjtThis.rids.add(lastRid);
}
(
<COMMA>
lastRid = Rid() { jjtThis.rids.add(lastRid); }
)*
] <RBRACKET>
)
)


) {return jjtThis;}
}
Expand Down
Expand Up @@ -12,6 +12,7 @@ public class ODeleteEdgeStatement extends OStatement {
protected OIdentifier targetClusterName;

protected ORid rid;
protected List<ORid> rids;

protected ORid leftRid;
protected List<ORid> leftRids;
Expand Down Expand Up @@ -58,11 +59,22 @@ public String toString() {
}
}


if (rid != null) {
result.append(" ");
result.append(rid.toString());
}
if (rids != null) {
result.append("[");
boolean first = true;
for (ORid rid : rids) {
if (!first) {
result.append(", ");
}
result.append(rid.toString());
first = false;
}
result.append("]");
}

if (leftRid != null || leftRids != null || leftStatement != null || leftParam != null || leftIdentifier != null) {
result.append(" FROM ");
Expand Down Expand Up @@ -132,7 +144,6 @@ public String toString() {
}
}


if (whereClause != null) {
result.append(" WHERE ");
result.append(whereClause.toString());
Expand Down

0 comments on commit 6d99108

Please sign in to comment.