Пример #1
0
 public virtual object CreateId(params object [] keyValues)
 {
     if (keyValues == null)
     {
         return(null);
     }
     if (Build())
     {
         //            Object o = idEntity.getBuilder().createObject();
         //            EntityBuilder f = idEntity.getBuilder();
         //            for (int i = 0; i < keyValues.length; i++) {
         //                f.setProperty(o, fieldNames[i], keyValues[i]);
         //            }
         return(keyValues[0]);
     }
     else
     {
         object o = bnfo.NewInstance();
         for (int i = 0; i < keyValues.Length; i++)
         {
             bnfo.SetProperty(o, fieldNames[i], keyValues[i]);
         }
         return(o);
     }
 }
Пример #2
0
 public override void SetProperty(object @object, string property, object @value) /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     if (@object is Net.Vpc.Upa.Record)
     {
         ((Net.Vpc.Upa.Record)@object).SetObject(property, @value);
     }
     else
     {
         nfo.SetProperty(@object, property, @value);
     }
 }
Пример #3
0
        public override void SetValue(object[] @value)
        {
            object o = userObject;

            System.Collections.Generic.ISet <string> names = nfo.GetPropertyNames();
            int i = 0;

            foreach (string name in names)
            {
                nfo.SetProperty(o, name, @value[i]);
                i++;
            }
        }
Пример #4
0
        public override T Parse(Net.Vpc.Upa.Persistence.QueryResult result) /* throws Net.Vpc.Upa.Exceptions.UPAException */
        {
            T instance = (T)beanType.NewInstance();

            for (int i = 0; i < columns; i++)
            {
                object v = result.Read <T>(i);
                if (fieldsByExpression[i] != null)
                {
                    beanType.SetProperty(instance, fieldsByExpression[i], v);
                }
            }
            return(instance);
        }
Пример #5
0
        public override void SetObject(string key, object @value)
        {
            SetUpdated(key);
            object oldValue = nfo.GetProperty(userObject, key);

            if (@value is Net.Vpc.Upa.Expressions.Expression || !nfo.SetProperty(userObject, key, @value))
            {
                // handle unstructured fields (non defined in the bean class)
                if (extra == null)
                {
                    extra = new System.Collections.Generic.Dictionary <string, object>();
                }
                extra[key] = @value;
            }
            FireChange(key, oldValue, @value);
        }