/// <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); } }
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; }
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);//������������ }