Beispiel #1
0
 public virtual object GetValueOf(string attributeName)
 {
     if (nnoi.IsNull())
     {
         throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.TriggerCalledOnNullObject
                                                    .AddParameter(nnoi.GetClassInfo().GetFullClassName()).AddParameter(attributeName
                                                                                                                       ));
     }
     return(nnoi.GetValueOf(attributeName));
 }
Beispiel #2
0
 public override string ToString()
 {
     System.Text.StringBuilder buffer = new System.Text.StringBuilder(classInfo.GetFullClassName
                                                                          ()).Append("(").Append(GetOid()).Append(")=");
     if (attributeValues == null)
     {
         buffer.Append("null attribute values");
         return(buffer.ToString());
     }
     for (int i = 0; i < attributeValues.Length; i++)
     {
         if (i != 0)
         {
             buffer.Append(",");
         }
         string attributeName = (classInfo != null ? (classInfo.GetAttributeInfo(i)).GetName
                                     () : "?");
         buffer.Append(attributeName).Append("=");
         object @object = attributeValues[i];
         if (@object == null)
         {
             buffer.Append(" null java object - should not happen , ");
         }
         else
         {
             NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType type = NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType
                                                                 .GetFromClass(attributeValues[i].GetType());
             if (@object is NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeNullObjectInfo)
             {
                 buffer.Append("null");
                 continue;
             }
             if (@object is NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeDeletedObjectInfo)
             {
                 buffer.Append("deleted object");
                 continue;
             }
             if (@object is NeoDatis.Odb.Core.Layers.Layer2.Meta.NativeObjectInfo)
             {
                 NeoDatis.Odb.Core.Layers.Layer2.Meta.NativeObjectInfo noi = (NeoDatis.Odb.Core.Layers.Layer2.Meta.NativeObjectInfo
                                                                              )@object;
                 buffer.Append(noi.ToString());
                 continue;
             }
             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;
                 buffer.Append("@").Append(nnoi.GetClassInfo().GetFullClassName()).Append("(id=").
                 Append(nnoi.GetOid()).Append(")");
                 continue;
             }
             if (@object is NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectReference)
             {
                 buffer.Append(@object.ToString());
                 continue;
             }
             buffer.Append("@").Append(NeoDatis.Tool.Wrappers.OdbClassUtil.GetClassName(type.GetName
                                                                                            ()));
         }
     }
     return(buffer.ToString());
 }