public void replaceParameters(Map<Object, Object> params) { if (leftStatement != null) { leftStatement.replaceParameters(params); } if (leftParam != null) { Object val = leftParam.bindFromInputParams(params); if (val != leftParam) { leftParamValue = val; } } if (rightStatement != null) { rightStatement.replaceParameters(params); } if (rightParam != null) { Object val = rightParam.bindFromInputParams(params); if (val != rightParam) { rightParamValue = val; } } if (body != null) { body.replaceParameters(params); } }
@Override public String toString() { StringBuilder result = new StringBuilder(); result.append("CREATE EDGE"); if (targetClass != null) { result.append(" "); result.append(targetClass.toString()); if (targetClusterName != null) { result.append(" CLUSTER "); result.append(targetClusterName.toString()); } } result.append(" FROM "); if (leftRid != null) { result.append(leftRid.toString()); } else if (leftRids != null) { result.append("["); boolean first = true; for (ORid rid : leftRids) { if (!first) { result.append(", "); } result.append(rid.toString()); first = false; } result.append("]"); } else if (leftStatement != null) { result.append("("); result.append(leftStatement.toString()); result.append(")"); } else if (leftParam != null) { if (leftParamValue == unset) { result.append(leftParam.toString()); } else if (leftParamValue == null) { result.append("NULL"); } else if (leftParamValue instanceof String) { result.append("\"" + OExpression.encode("" + leftParamValue) + "\""); } else { result.append(leftParamValue.toString()); } } else if (leftIdentifier != null) { result.append(leftIdentifier.toString()); } result.append(" TO "); if (rightRid != null) { result.append(rightRid.toString()); } else if (rightRids != null) { result.append("["); boolean first = true; for (ORid rid : rightRids) { if (!first) { result.append(", "); } result.append(rid.toString()); first = false; } result.append("]"); } else if (rightStatement != null) { result.append("("); result.append(rightStatement.toString()); result.append(")"); } else if (rightParam != null) { if (rightParamValue == unset) { result.append(rightParam.toString()); } else if (rightParamValue == null) { result.append("NULL"); } else if (rightParamValue instanceof String) { result.append("\"" + OExpression.encode("" + rightParamValue) + "\""); } else { result.append(rightParamValue.toString()); } } else if (rightIdentifier != null) { result.append(rightIdentifier.toString()); } if (body != null) { result.append(" "); result.append(body.toString()); } if (retry != null) { result.append(" RETRY "); result.append(retry); } if (wait != null) { result.append(" WAIT "); result.append(wait); } return result.toString(); }