Castle ActiveRecord学习实践(1):映射基础 yangan

一.ActiveRecordAttribute

  每一个实体类都必须继承于基类ActiveRecordBase,并在实体类上设置特性ActiveRecordAttribute

二.PrimaryKeyAttribute

在实体类中,通过PrimaryKeyAttribute来指定表的主键

三.CompositeKeyAttribute

如果使用组合键,需要我们自定义一个类来作为主键属性的类型。

四.PropertyAttribute

ActiveRecord中通过PropertyAttribute来指定实体类属性与数据库中的字段映射。

五.FieldAttribute

在ActiveRecord中,允许我们直接对Field进行映射,使用FieldAttribute

六.NestedAttribute

在映射的时候我们也可以用子对象来映射数据库中的字段

详细介绍:http://terrylee.cnblogs.com/archive/2006/04/06/367978.html

 

参考资料

http://terrylee.cnblogs.com/archive/2006/04/06/367978.html

 

 

 

原文地址:https://www.cnblogs.com/xlx0210/p/1659571.html