public OJson splitForAggregation(AggregateProjectionSplit aggregateSplit, OCommandContext ctx) { if (isAggregate()) { OJson result = new OJson(-1); for (OJsonItem item : items) { result.items.add(item.splitForAggregation(aggregateSplit, ctx)); } return result; } else { return this; } }
public OInsertBody copy() { OInsertBody result = new OInsertBody(-1); result.identifierList = identifierList == null ? null : identifierList.stream().map(x -> x.copy()).collect(Collectors.toList()); result.valueExpressions = valueExpressions == null ? null : valueExpressions.stream().map(sub -> sub.stream().map(x -> x.copy()).collect(Collectors.toList())) .collect(Collectors.toList()); result.setExpressions = setExpressions == null ? null : setExpressions.stream().map(x -> x.copy()).collect(Collectors.toList()); result.content = content == null ? null : content.copy(); result.contentInputParam = contentInputParam == null ? null : contentInputParam.copy(); return result; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OInsertBody that = (OInsertBody) o; if (identifierList != null ? !identifierList.equals(that.identifierList) : that.identifierList != null) return false; if (valueExpressions != null ? !valueExpressions.equals(that.valueExpressions) : that.valueExpressions != null) return false; if (setExpressions != null ? !setExpressions.equals(that.setExpressions) : that.setExpressions != null) return false; if (content != null ? !content.equals(that.content) : that.content != null) return false; return contentInputParam != null ? contentInputParam.equals(that.contentInputParam) : that.contentInputParam == null; }
/** * choosing return type is based on existence of @class and @type field in JSON * @param source * @param ctx * @return */ public Object toObjectDetermineType(OResult source, OCommandContext ctx){ String className = getClassNameForDocument(ctx); String type = getTypeForDocument(ctx); if (className != null || (type != null && "d".equalsIgnoreCase(type))) { return toDocument(source, ctx, className); } else{ return toMap(source, ctx); } }
arrayConcatExpression.toString(params, builder); } else if (json != null) { json.toString(params, builder); } else if (booleanValue != null) { builder.append(booleanValue.toString());
final public OJson Json() throws ParseException { OJson jjtn000 = new OJson(JJTJSON); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1));OJsonItem lastItem; Token token; try { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtn000.jjtSetLastToken(getToken(0)); {if (true) return jjtn000;} } catch (Throwable jjte000) { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtn000.jjtSetLastToken(getToken(0));
public ODocument toDocument(OIdentifiable source, OCommandContext ctx) { String className = getClassNameForDocument(ctx); ODocument doc; if (className != null) { doc = new ODocument(className); } else { doc = new ODocument(); } for (OJsonItem item : items) { String name = item.getLeftValue(); if (name == null) { continue; } Object value; if (item.right.value instanceof OJson) { value = ((OJson) item.right.value).toDocument(source, ctx); } else { value = item.right.execute(source, ctx); } doc.field(name, value); } return doc; }
public void deserialize(OResult fromResult) { singleQuotes = fromResult.getProperty("singleQuotes"); doubleQuotes = fromResult.getProperty("doubleQuotes"); isNull = fromResult.getProperty("isNull"); if (fromResult.getProperty("rid") != null) { rid = new ORid(-1); rid.deserialize(fromResult.getProperty("rid")); } if (fromResult.getProperty("mathExpression") != null) { mathExpression = OMathExpression.deserializeFromResult(fromResult.getProperty("mathExpression")); } if (fromResult.getProperty("arrayConcatExpression") != null) { arrayConcatExpression = new OArrayConcatExpression(-1); arrayConcatExpression.deserialize(fromResult.getProperty("arrayConcatExpression")); } if (fromResult.getProperty("json") != null) { json = new OJson(-1); json.deserialize(fromResult.getProperty("json")); } booleanValue = fromResult.getProperty("booleanValue"); }
@Override public int hashCode() { int result = type; result = 31 * result + (updateItems != null ? updateItems.hashCode() : 0); result = 31 * result + (updatePutItems != null ? updatePutItems.hashCode() : 0); result = 31 * result + (json != null ? json.hashCode() : 0); result = 31 * result + (updateIncrementItems != null ? updateIncrementItems.hashCode() : 0); result = 31 * result + (updateRemoveItems != null ? updateRemoveItems.hashCode() : 0); return result; }
public void extractSubQueries(SubQueryCollector collector) { if (mathExpression != null) { mathExpression.extractSubQueries(collector); } if (arrayConcatExpression != null) { arrayConcatExpression.extractSubQueries(collector); } if (json != null) { json.extractSubQueries(collector); } }
public OJson copy() { OJson result = new OJson(-1); result.items = items.stream().map(x -> x.copy()).collect(Collectors.toList()); return result; }
public boolean isAggregate() { if (mathExpression != null && mathExpression.isAggregate()) { return true; } if (arrayConcatExpression != null && arrayConcatExpression.isAggregate()) { return true; } if (json != null && json.isAggregate()) { return true; } return false; }
content.toString(params, builder); } else if (contentInputParam != null) { builder.append("CONTENT ");
@Override public int hashCode() { int result = identifierList != null ? identifierList.hashCode() : 0; result = 31 * result + (valueExpressions != null ? valueExpressions.hashCode() : 0); result = 31 * result + (setExpressions != null ? setExpressions.hashCode() : 0); result = 31 * result + (content != null ? content.hashCode() : 0); result = 31 * result + (contentInputParam != null ? contentInputParam.hashCode() : 0); return result; }
public void extractSubQueries(OIdentifier letAlias, SubQueryCollector collector) { if (mathExpression != null) { mathExpression.extractSubQueries(letAlias, collector); } if (arrayConcatExpression != null) { arrayConcatExpression.extractSubQueries(collector); } if (json != null) { json.extractSubQueries(collector); } }
OJson json = new OJson(-1); json.items = new ArrayList<OJsonItem>(); for (Object entry : ((Map) value).entrySet()) {
public OUpdateOperations copy() { OUpdateOperations result = new OUpdateOperations(-1); result.type = type; result.updateItems = updateItems == null ? null : updateItems.stream().map(x -> x.copy()).collect(Collectors.toList()); result.updatePutItems = updatePutItems == null ? null : updatePutItems.stream().map(x -> x.copy()).collect(Collectors.toList()); result.json = json == null ? null : json.copy(); result.updateIncrementItems = updateIncrementItems == null ? null : updateIncrementItems.stream().map(x -> x.copy()).collect(Collectors.toList()); result.updateRemoveItems = updateRemoveItems == null ? null : updateRemoveItems.stream().map(x -> x.copy()).collect(Collectors.toList()); return result; }
@Override public int hashCode() { int result = singleQuotes != null ? singleQuotes.hashCode() : 0; result = 31 * result + (doubleQuotes != null ? doubleQuotes.hashCode() : 0); result = 31 * result + (isNull ? 1 : 0); result = 31 * result + (rid != null ? rid.hashCode() : 0); result = 31 * result + (mathExpression != null ? mathExpression.hashCode() : 0); result = 31 * result + (arrayConcatExpression != null ? arrayConcatExpression.hashCode() : 0); result = 31 * result + (json != null ? json.hashCode() : 0); result = 31 * result + (booleanValue != null ? booleanValue.hashCode() : 0); return result; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OUpdateOperations that = (OUpdateOperations) o; if (type != that.type) return false; if (updateItems != null ? !updateItems.equals(that.updateItems) : that.updateItems != null) return false; if (updatePutItems != null ? !updatePutItems.equals(that.updatePutItems) : that.updatePutItems != null) return false; if (json != null ? !json.equals(that.json) : that.json != null) return false; if (updateIncrementItems != null ? !updateIncrementItems.equals(that.updateIncrementItems) : that.updateIncrementItems != null) return false; if (updateRemoveItems != null ? !updateRemoveItems.equals(that.updateRemoveItems) : that.updateRemoveItems != null) return false; return true; }