/// <summary>Used to change the value of an attribute</summary> /// <param name="attributeName"></param> /// <param name="aoi"></param> public virtual void SetValueOf(string attributeName, NeoDatis.Odb.Core.Layers.Layer2.Meta.AbstractObjectInfo aoi) { int attributeId = -1; bool isRelation = attributeName.IndexOf(".") != -1; if (!isRelation) { attributeId = GetClassInfo().GetAttributeId(attributeName); SetAttributeValue(attributeId, aoi); return; } int firstDotIndex = attributeName.IndexOf("."); string firstAttributeName = NeoDatis.Tool.Wrappers.OdbString.Substring(attributeName , 0, firstDotIndex); attributeId = GetClassInfo().GetAttributeId(firstAttributeName); object @object = attributeValues[attributeId]; if (@object is NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo) { NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi = (NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo )@object; nnoi.SetValueOf(NeoDatis.Tool.Wrappers.OdbString.Substring(attributeName, firstDotIndex + 1, attributeName.Length), aoi); } throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.ClassInfoDoNotHaveTheAttribute .AddParameter(GetClassInfo().GetFullClassName()).AddParameter(attributeName)); }
public virtual void SetValueOf(string attributeName, object value) { //fixme : storage engine is null? NeoDatis.Odb.Core.Layers.Layer1.Introspector.IObjectIntrospector introspector = NeoDatis.Odb.OdbConfiguration .GetCoreProvider().GetLocalObjectIntrospector(null); NeoDatis.Odb.Core.Layers.Layer2.Meta.AbstractObjectInfo aoi = introspector.GetMetaRepresentation (value, null, true, null, new NeoDatis.Odb.Impl.Core.Layers.Layer1.Introspector.DefaultInstrumentationCallback ()); nnoi.SetValueOf(attributeName, aoi); }