You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZKLT.Hadoop.Model
{
/// <summary>
/// 数据列
/// </summary>
[AttributeUsage(AttributeTargets.Property, Inherited = true)]
[HDP_Table(Key = "HDP_Column", Description = "列")]
public class HDP_Column : Attribute
{
private string? _Id;
private string? _TableId;
private string? _Key;
private bool _IsPrimary;
private string? _Description;
private string? _DataType;
private int _Length;
private int _DecimalLength;
private string? _InsertDefault;
private string? _UpdateDefault;
/// <summary>
/// 编号
/// </summary>
[HDP_Column(Key = "Id", Description = "编号", Length = 100, DataType = HDP_ColumnDataType.VARCHAR, IsPrimary = true)]
public string? Id { get => _Id; set => _Id = value; }
/// <summary>
/// 表编号
/// </summary>
[HDP_Column(Key = "TableId", Description = "表编号", Length = 100, DataType = HDP_ColumnDataType.VARCHAR)]
public string? TableId { get => _TableId; set => _TableId = value; }
/// <summary>
/// 列名
/// </summary>
[HDP_Column(Key = "Key", Description = "列名", Length = 100, DataType = HDP_ColumnDataType.VARCHAR)]
public string? Key { get => _Key; set => _Key = value; }
/// <summary>
/// 是否主键
/// </summary>
[HDP_Column(Key = "IsPrimary", Description = "是否主键", DataType = HDP_ColumnDataType.BOOL)]
public bool IsPrimary { get => _IsPrimary; set => _IsPrimary = value; }
/// <summary>
/// 描述
/// </summary>
[HDP_Column(Key = "Description", Description = "描述", Length = 200, DataType = HDP_ColumnDataType.VARCHAR)]
public string? Description { get => _Description; set => _Description = value; }
/// <summary>
/// 数据类型
/// </summary>
[HDP_Column(Key = "DataType", Description = "数据类型", Length = 100, DataType = HDP_ColumnDataType.VARCHAR)]
public string? DataType { get => _DataType; set => _DataType = value; }
/// <summary>
/// 长度
/// </summary>
[HDP_Column(Key = "Length", Description = "长度", DataType = HDP_ColumnDataType.INT)]
public int Length { get => _Length; set => _Length = value; }
/// <summary>
/// 小数长度
/// </summary>
[HDP_Column(Key = "DecimalLength", Description = "小数长度", DataType = HDP_ColumnDataType.INT)]
public int DecimalLength { get => _DecimalLength; set => _DecimalLength = value; }
/// <summary>
/// 插入默认值
/// </summary>
[HDP_Column(Key = "InsertDefault", Description = "插入默认值", Length = 100, DataType = HDP_ColumnDataType.VARCHAR)]
public string? InsertDefault { get => _InsertDefault; set => _InsertDefault = value; }
/// <summary>
/// 更新默认值
/// </summary>
[HDP_Column(Key = "UpdateDefault", Description = "更新默认值", Length = 100, DataType = HDP_ColumnDataType.VARCHAR)]
public string? UpdateDefault { get => _UpdateDefault; set => _UpdateDefault = value; }
}
}