示例#1
0
        /// <summary>
        /// �����¶���
        /// </summary>
        /// <param name="colAttr">����������</param>
        /// <param name="prop">��֮������������Ϣ</param>
        public PropertyColumn(ColumnMappingAttribute colAttr, PropertyInfo prop)
            : base(colAttr)
        {
            if (prop == null)
            {
                throw new ArgumentNullException();
            }

            this.prop = prop;

            getter = prop.GetGetMethod();
            setter = prop.GetSetMethod();

            if (colAttr.Name == null || colAttr.Name == string.Empty)
                this.Name = prop.Name;
            else
                this.Name = colAttr.Name;

            if (this.DataType == typeof(object))
            {
                throw new OrmLogicException("Not Allowed to declare Object type as basic column");
            }

            if (colAttr.DbType == System.Data.DbType.Object)
            {
                //������������
                this.DbType = DbFunction.BuildDbType(this.DataType);
            }
        }
示例#2
0
文件: Column.cs 项目: dalinhuang/myxx
        string tableName; //�����ĸ�����

        #endregion Fields

        #region Constructors

        public Column(ColumnMappingAttribute colAttr)
        {
            this.dbType = colAttr.DbType;
            this.isPrimaryKey = colAttr.PrimaryKey;
            this.isAllowNullValue = colAttr.AllowNullValue;
            this.size = colAttr.Size;
            this.isPrimaryKeyParty = colAttr.PrimaryKeyParty;
            this.isAutoincrement = colAttr.Autoincrement;
            this.isForeignKey = colAttr.IsForeignKey;
            this.foreignKey = colAttr.ForeignKey;
            this.foreignTable = colAttr.ForeignTable;
            this.tableName = colAttr.TableName;
            this.nameAlias = colAttr.NameAlias;
        }
示例#3
0
        public FieldColumn(ColumnMappingAttribute colAttr, FieldInfo field)
            : base(colAttr)
        {
            if (field == null)
                throw new ArgumentNullException();

            this.field = field;

            if (colAttr.Name == null || colAttr.Name == string.Empty)
                this.Name = field.Name;
            else
                this.Name = colAttr.Name;

            //�����ڻ��������������������������ͣ��������ж������е���������
            if (this.DataType == typeof(object))
                throw new OrmLogicException("Not Allowed to declare Object type as basic column");

            if (colAttr.DbType == System.Data.DbType.Object)
                this.DbType = DbFunction.BuildDbType(this.DataType);//������������
        }