using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace Ant.ORM
{
///
/// 子对象特性
///
[AttributeUsage(AttributeTargets.Property)]
public class ChildAttribute : Attribute
{
private string _ChildTable;
private string _maintable;
private string[] _ChildTableFields;
private DbType[] _DataType;
private string _Key;
private string[] _ParentTableFields;
private string _ShowField;
///
/// 子对象
///
/// 关键字
/// 外键所在的表
/// 父表字段
/// 子表字段名
/// 数据类型
public ChildAttribute(string key, string maintable, string childTable, string[] parentTableFields, string[] childTableFields, DbType[] dataType, string showField)
{
this._Key = key;
this._maintable = maintable;
this._ChildTable = childTable;
this._ParentTableFields = parentTableFields;
this._ChildTableFields = childTableFields;
this._DataType = dataType;
this._ShowField = showField;
}
///
/// 外键所在的表
///
public string ChildTable
{
get
{
return this._ChildTable;
}
}
///
/// 外键所在的表
///
public string MainTable
{
get
{
return this._maintable;
}
}
///
/// 子表字段名
///
public string[] ChildTableFields
{
get
{
return this._ChildTableFields;
}
}
///
/// 数据类型
///
public DbType[] DataType
{
get
{
return this._DataType;
}
}
///
/// 关键字
///
public string Key
{
get
{
return this._Key;
}
}
///
/// 父表字段
///
public string[] ParentTableFields
{
get
{
return this._ParentTableFields;
}
}
///
/// 显示值的字段
///
public string ShowField
{
get
{
return this._ShowField;
}
}
}
}