using System;
using System.Collections.Generic;
using System.Text;
using Ant.Frame;
using System.Reflection;
using Ant.Core.Visitors;
using Ant.Descriptors;
using Ant.DbExpressions;
namespace Ant.ORM
{
///
/// 类成员的属性
///
public class FiledMetaData
{
Dictionary _mappingMemberDescriptors;
///
/// 类中所有成员属性
///
public Dictionary MappingMemberDescriptors
{
get { return this._mappingMemberDescriptors; }
set { _mappingMemberDescriptors = value; }
}
Dictionary _memberColumnMap;
///
/// 对应数据库字段
///
public Dictionary MemberColumnMap
{
get { return this._memberColumnMap; }
set { _memberColumnMap = value; }
}
private List _fields;
///
/// 实体的值集合
///
public List Fields
{
get { return _fields; }
set { _fields = value; }
}
MappingMemberDescriptor _primaryKey = null;
///
/// 主键
///
public MappingMemberDescriptor PrimaryKey
{
get { return this._primaryKey; }
set { _primaryKey = value; }
}
MappingMemberDescriptor _autoIncrement = null;
///
/// 自增长
///
public MappingMemberDescriptor AutoIncrement
{
get { return this._autoIncrement; }
set { _autoIncrement = value; }
}
///
/// 类中表名
///
public DbTable Table
{
get; set;
}
///
/// 实体类属性
///
public Type EntityType { get; set; }
///
///
///
public PropertyInfo[] Propertys { get; set; }
DefaultExpressionVisitor _visitor = null;
///
///
///
public DefaultExpressionVisitor Visitor
{
get
{
if (this._visitor == null)
this._visitor = new DefaultExpressionVisitor(this);
return this._visitor;
}
}
}
///
/// 类成员属性和类值实体
///
public class MetaData
{
public MetaData()
{
}
#region 属性
///
/// 实体属性
///
public FiledMetaData FiledMeta
{
get; set;
}
///
/// 找出实体中有值的集合DbColumn是实体中属性名和属性值,DbExpression是用查询
///
public Dictionary FieldsColumns
{
get; set;
}
///
/// 找出实体中有值的集合
///
public Dictionary WhereColumns
{
get; set;
}
/////
///// 状态值属性一般用Update操作
/////
//public Dictionary Values
//{
// get; set;
//}
///
/// 更新列
///
public Dictionary UpdateColumns
{
get; set;
}
private EntityPersistType persistType;
///
/// 操作类型
///
public EntityPersistType PersistType
{
get { return persistType; }
set { persistType = value; }
}
//private string _moduleName;
/////
///// 模块
/////
//public string ModuleName
//{
// get { return _moduleName; }
// set { _moduleName = value; }
//}
///
/// 自定义查询条件
///
public string WhereSql
{
get; set;
}
#endregion
}
}