コード例 #1
0
ファイル: BeanAdapterKey.cs プロジェクト: nesrinesghaier/upa
        public override object[] GetValue()
        {
            object o = userObject;

            System.Collections.Generic.ISet <string> names = nfo.GetPropertyNames();
            object[] v = new object[(names).Count];
            int      i = 0;

            foreach (string name in names)
            {
                v[i] = nfo.GetProperty(o, name);
                i++;
            }
            return(v);
        }
コード例 #2
0
 public TypeList(Net.Vpc.Upa.Impl.Persistence.QueryExecutor queryExecutor, System.Type entity, string[] fields)  : base(queryExecutor)
 {
     Net.Vpc.Upa.Impl.Persistence.NativeField[] expressions = queryExecutor.GetFields();
     this.fields = fields;
     beanType    = Net.Vpc.Upa.Impl.Util.PlatformBeanTypeRepository.GetInstance().GetBeanType(entity);
     if (fields == null || fields.Length == 0)
     {
         System.Collections.Generic.ISet <string> fieldNames = beanType.GetPropertyNames();
         this.fields = fieldNames.ToArray();
     }
     fieldsByExpression = new string[expressions.Length];
     for (int i = 0; i < fieldsByExpression.Length; i++)
     {
         Net.Vpc.Upa.Impl.Persistence.NativeField e = expressions[i];
         string name = e.GetName();
         foreach (string field in this.fields)
         {
             if (name.Equals(field))
             {
                 fieldsByExpression[i] = field;
                 break;
             }
         }
     }
     columns = expressions.Length;
 }
コード例 #3
0
        public override System.Collections.Generic.ISet <string> KeySet()
        {
            bool?includeDefaults = null;

            if (ignoreUnspecified)
            {
                includeDefaults = false;
            }
            System.Collections.Generic.ISet <string> keySet = nfo.GetPropertyNames(userObject, includeDefaults);
            if (extra != null && (extra).Count > 0)
            {
                Net.Vpc.Upa.Impl.FwkConvertUtils.CollectionAddRange(keySet, new System.Collections.Generic.HashSet <string>(extra.Keys));
            }
            return(keySet);
        }
コード例 #4
0
ファイル: KeyBeanFactory.cs プロジェクト: nesrinesghaier/upa
 private bool Build()
 {
     if (this.fieldNames == null)
     {
         idEntity = entity.GetPersistenceUnit().FindEntity(idType);
         if (idEntity != null)
         {
             isEntityKey = true;
             System.Collections.Generic.IList <string> fn = new System.Collections.Generic.List <string>();
             //                for (Field primaryField : entity.getPrimaryFields()) {
             //                    fn.add(primaryField.getName());
             //                }
             this.fieldNames = fn.ToArray();
         }
         else
         {
             bnfo = Net.Vpc.Upa.Impl.Util.PlatformBeanTypeRepository.GetInstance().GetBeanType(idType);
             System.Collections.Generic.ISet <string> fn = bnfo.GetPropertyNames();
             this.fieldNames = fn.ToArray();
         }
     }
     return(isEntityKey);
 }