コード例 #1
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;
 }
コード例 #2
0
 public EntityBeanFactory(Net.Vpc.Upa.Entity entity, Net.Vpc.Upa.ObjectFactory objectFactory)
 {
     this.entity        = entity;
     this.nfo           = entity.GetBeanType();
     this.objectFactory = objectFactory;
     System.Collections.Generic.IList <Net.Vpc.Upa.Field> fields = entity.GetFields();
 }
コード例 #3
0
 public BeanAdapterRecord(object userObject, string entityName, Net.Vpc.Upa.BeanType nfo, bool ignoreUnspecified)
 {
     this.userObject        = userObject;
     this.entityName        = entityName;
     this.nfo               = nfo;
     this.ignoreUnspecified = ignoreUnspecified;
     propertyChangeSupport  = new Net.Vpc.Upa.PropertyChangeSupport(this);
 }
コード例 #4
0
 public EntityBeanType(Net.Vpc.Upa.Entity entity)
 {
     this.platformBeanType = Net.Vpc.Upa.Impl.Util.PlatformBeanTypeRepository.GetInstance().GetBeanType(entity.GetEntityType());
     this.entity           = entity;
     try {
         //entity.GetEntityType().GetConstructor().SetAccessible(true);
     } catch (System.Exception e) {
         throw new System.ArgumentException("Unable to resolve default constructor for type " + entity.GetEntityType() + " (entity " + entity.GetName() + ")", e);
     }
     foreach (Net.Vpc.Upa.Field field in entity.GetFields())
     {
         GetAttrAdapter(field.GetName());
     }
 }
コード例 #5
0
 public virtual Net.Vpc.Upa.BeanType GetBeanType(System.Type cls)
 {
     Net.Vpc.Upa.BeanType beanType = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <System.Type, Net.Vpc.Upa.BeanType>(classBeanTypeReflectorMap, cls);
     if (beanType == null)
     {
         lock (classBeanTypeReflectorMap) {
             beanType = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <System.Type, Net.Vpc.Upa.BeanType>(classBeanTypeReflectorMap, cls);
             if (beanType == null)
             {
                 beanType = new Net.Vpc.Upa.Impl.Util.DefaultBeanType(cls);
                 classBeanTypeReflectorMap[cls] = beanType;
             }
         }
     }
     return(beanType);
 }
コード例 #6
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);
 }
コード例 #7
0
 public CustomRecordBeanType(Net.Vpc.Upa.Entity entity, System.Type customType)  : base(entity)
 {
     this.customType = Net.Vpc.Upa.Impl.Util.PlatformBeanTypeRepository.GetInstance().GetBeanType(customType);
 }
コード例 #8
0
 public KeySubclassUnstructuredFactory(Net.Vpc.Upa.BeanType nfo)
 {
     this.nfo = nfo;
 }
コード例 #9
0
 public DefaultBeanAdapter(System.Type cls)
 {
     this.beanType = Net.Vpc.Upa.Impl.Util.PlatformBeanTypeRepository.GetInstance().GetBeanType(cls);
 }
コード例 #10
0
ファイル: BeanAdapterKey.cs プロジェクト: nesrinesghaier/upa
 public BeanAdapterKey(System.Type keyType, object userObject, Net.Vpc.Upa.Entity entity)
 {
     this.keyType    = keyType;
     this.userObject = userObject;
     nfo             = Net.Vpc.Upa.Impl.Util.PlatformBeanTypeRepository.GetInstance().GetBeanType(keyType);
 }