public object GetByAlias(string alias) { var valueByAlias = _valuesByAlias[alias]; if (valueByAlias == null && !_valuesByAlias.ContainsKey(alias)) { throw new OdbRuntimeException( NDatabaseError.ValuesQueryAliasDoesNotExist.AddParameter(alias).AddParameter(_valuesByAlias.Keys)); } return(valueByAlias); }
private void AddModifiedOid(OID oid) { if (_modifiedObjectOids.ContainsKey(oid)) { // Object is already in the list return; } _modifiedObjectOidList.Add(oid); // Keep the position of the oid in the list as the value of the map. // Used for the delete. _modifiedObjectOids.Add(oid, _modifiedObjectOidList.Count - 1); }
/// <summary> /// Returns the list of involved fields for this query. /// </summary> /// <remarks> /// Returns the list of involved fields for this query. List of String <pre>If query must return sum("value") and field("name"), involvedField will contain "value","name"</pre> /// </remarks> public override IOdbList <string> GetAllInvolvedFields() { IOdbList <string> list = new OdbList <string>(); // To check field duplicity IDictionary <string, string> map = new OdbHashMap <string, string>(); list.AddAll(base.GetAllInvolvedFields()); if (!list.IsNullOrEmpty()) { foreach (var value in list) { map.Add(value, value); } } var iterator = _objectActions.GetEnumerator(); string name; while (iterator.MoveNext()) { var queryFieldAction = iterator.Current; if (queryFieldAction is CountAction) { continue; } name = queryFieldAction.GetAttributeName(); if (map.ContainsKey(name)) { continue; } list.Add(name); map.Add(name, name); } if (_hasGroupBy) { foreach (var groupByField in _groupByFieldList) { name = groupByField; if (map.ContainsKey(name)) { continue; } list.Add(name); map.Add(name, name); } } if (HasOrderBy()) { foreach (var field in OrderByFields) { name = field; if (map.ContainsKey(name)) { continue; } list.Add(name); map.Add(name, name); } } map.Clear(); return(list); }