@Override public void toString(Map<Object, Object> params, StringBuilder builder) { builder.append("TRUNCATE RECORD "); if (record != null) { record.toString(params, builder); } else { builder.append("["); boolean first = true; for (ORid r : records) { if (!first) { builder.append(","); } r.toString(params, builder); first = false; } builder.append("]"); } }
public void toString(Map<Object, Object> params, StringBuilder builder) { if (alias != null) { builder.append(alias); if (modifier != null) { modifier.toString(params, builder); } } else if (recordAttr != null) { builder.append(recordAttr); } else if (rid != null) { rid.toString(params, builder); } if (type != null) { builder.append(" " + type); } if (collate != null) { builder.append(" COLLATE "); collate.toString(params, builder); } }
@Override public void toString(Map<Object, Object> params, StringBuilder builder) { builder.append("FIND REFERENCES "); if (rid != null) { rid.toString(params, builder); } else { builder.append(" ( "); subQuery.toString(params, builder); builder.append(" )"); } if (targets != null) { builder.append(" ["); boolean first = true; for (SimpleNode node : targets) { if (!first) { builder.append(","); } node.toString(params, builder); first = false; } builder.append("]"); } }
public void toString(Map<Object, Object> params, StringBuilder builder) { if (rid != null) { rid.toString(params, builder); } else if (inputParam != null) { inputParam.toString(params, builder); } else if (expression != null) { expression.toString(params, builder); } else if (integer != null) { integer.toString(params, builder); } }
builder.append("null"); } else if (rid != null) { rid.toString(params, builder); } else if (mathExpression != null) { mathExpression.toString(params, builder);
rid.toString(params, builder); return;
@Override public OResultSet executeSimple(OCommandContext ctx) { List<ORid> recs = new ArrayList<>(); if (record != null) { recs.add(record); } else { recs.addAll(records); } OInternalResultSet rs = new OInternalResultSet(); final ODatabaseDocumentInternal database = (ODatabaseDocumentInternal) ctx.getDatabase(); for (ORid rec : recs) { try { final ORecordId rid = rec.toRecordId((OResult) null, ctx); final OStorageOperationResult<Boolean> result = database.getStorage().deleteRecord(rid, -1, 0, null); database.getLocalCache().deleteRecord(rid); if (result.getResult()) { OResultInternal recordRes = new OResultInternal(); recordRes.setProperty("operation", "truncate record"); recordRes.setProperty("record", rec.toString()); rs.add(recordRes); } } catch (Exception e) { throw OException.wrapException(new OCommandExecutionException("Error on executing command"), e); } } return rs; }