@Override public boolean containsValue(Object value) { return document.toMap().containsValue(value); }
@Override public boolean containsValue(Object value) { return document.toMap().containsValue(value); }
/** * Builds {@link SortField} from a configuration {@link ODocument} * * @param conf * * @return */ public static SortField buildSortField(ODocument conf) { return buildSortField(conf.toMap()); }
@Override protected void readFields(final ODocument document, final HttpClientConfiguration entity) throws Exception { ObjectReader reader = objectMapper.readerForUpdating(entity); TokenBuffer buff = new TokenBuffer(objectMapper, false); Map<String, Object> fields = document.toMap(); // strip out id/class synthetics fields.remove("@rid"); fields.remove("@class"); log.trace("Reading fields: {}", fields); objectMapper.writeValue(buff, fields); reader.readValue(buff.asParser()); }
return ((ODocument) ioResult).toMap();
@Override public <U> Iterator<Property<U>> properties(String... propertyKeys) { if (!hasMetadataDocument()) return Collections.emptyIterator(); Map<String, Object> properties = getMetadataDocument().toMap(); HashSet<String> keys = new HashSet<>(Arrays.asList(propertyKeys)); Stream<Map.Entry<String, Object>> entries = StreamUtils.asStream(properties.entrySet().iterator()); if (keys.size() > 0) { entries = entries.filter(entry -> keys.contains(entry.getKey())); } @SuppressWarnings("unchecked") Stream<Property<U>> propertyStream = entries.filter(entry -> !entry.getKey().startsWith("@rid")) .map(entry -> new OrientVertexPropertyProperty<>(entry.getKey(), (U) entry.getValue(), this)); return propertyStream.iterator(); }
private Map<String, Object> toParamMap(ODocument input){ Map<String, Object> out = input.toMap(); if (out.containsKey(ODocumentHelper.ATTRIBUTE_RID)){ out.put(getOrientDBEndpoint().getRecordIdField(), out.remove(ODocumentHelper.ATTRIBUTE_RID)); } if (out.containsKey(ODocumentHelper.ATTRIBUTE_CLASS)){ out.put(getOrientDBEndpoint().getClassField(), out.remove(ODocumentHelper.ATTRIBUTE_CLASS)); } return out; }
private void bindAdditionalParams(Object additionalParams, OShortestPathContext ctx) { if (additionalParams == null) { return; } Map<String, Object> mapParams = null; if (additionalParams instanceof Map) { mapParams = (Map) additionalParams; } else if (additionalParams instanceof OIdentifiable) { mapParams = ((ODocument) ((OIdentifiable) additionalParams).getRecord()).toMap(); } if (mapParams != null) { ctx.maxDepth = integer(mapParams.get("maxDepth")); } }
private void bindAdditionalParams(Object additionalParams, OShortestPathContext ctx) { if (additionalParams == null) { return; } Map<String, Object> mapParams = null; if (additionalParams instanceof Map) { mapParams = (Map) additionalParams; } else if (additionalParams instanceof OIdentifiable) { mapParams = ((ODocument) ((OIdentifiable) additionalParams).getRecord()).toMap(); } if (mapParams != null) { ctx.maxDepth = integer(mapParams.get("maxDepth")); Boolean withEdge = toBoolean(mapParams.get("edge")); ctx.edge = Boolean.TRUE.equals(withEdge) ? Boolean.TRUE : Boolean.FALSE; } }
mapParams = (Map) additionalParams; } else if (additionalParams instanceof OIdentifiable) { mapParams = ((ODocument) ((OIdentifiable) additionalParams).getRecord()).toMap();
mapParams = (Map) additionalParams; } else if (additionalParams instanceof OIdentifiable) { mapParams = ((ODocument) ((OIdentifiable) additionalParams).getRecord()).toMap();
OrientVertex rule = (OrientVertex)graph.getVertexByKey("Rule.ruleClass", ruleClass); if(rule != null) { map = rule.getRecord().toMap();
protected OLuceneResultSet results(OFromClause target, OExpression[] args, OCommandContext ctx, Object rightValue) { OIndex oIndex = searchForIndex(target, args); if (oIndex == null) { return null; } Map<String, Object> queryParams = new HashMap<>(); queryParams.put(SpatialQueryBuilderAbstract.GEO_FILTER, operator()); Object shape; if (args[1].getValue() instanceof OJson) { OJson json = (OJson) args[1].getValue(); ODocument doc = new ODocument().fromJSON(json.toString()); shape = doc.toMap(); } else { shape = args[1].execute((OIdentifiable) null, ctx); } queryParams.put(SpatialQueryBuilderAbstract.SHAPE, shape); onAfterParsing(queryParams, args, ctx, rightValue); Set<String> indexes = (Set<String>) ctx.getVariable("involvedIndexes"); if (indexes == null) { indexes = new HashSet<>(); ctx.setVariable("involvedIndexes", indexes); } indexes.add(oIndex.getName()); return (OLuceneResultSet) oIndex.get(queryParams); }
restUrl = "/orientdb/query/db/sql/"+UrlEncoder.PATH_INSTANCE.encode(getSql(), "UTF-8")+"/-1?rnd="+Math.random(); }else{ List<ODocument> testData = new OSQLSynchQuery<ODocument>(getSql()).run(getDefaultModelObject()!=null?((ODocument)getDefaultModelObject()).toMap():null) ; jsonData = "["; for ( ODocument object : testData) {
} else if (fieldName.equals("engineProperties")) { final String jsonEngineProperties = jsonReader.readString(OJSONReader.END_OBJECT, true); Map<String, Object> map = new ODocument().fromJSON(jsonEngineProperties).toMap(); if (map != null) { engineProperties = new HashMap<>(map.size());