Castle ActiveRecord学习实践:多种关系映射

One-One特性  [OneToOne(Cascade=CascadeEnum.All)]

Own-Own特性 [HasMany(typeof(Department), Table = "tb_Department", ColumnKey = "ParentId", Lazy = true, Inverse = true, Cascade = ManyRelationCascadeEnum.AllDeleteOrphan)]

One-Many特性 [HasMany(typeof(Post), Table = "posts", ColumnKey = "post_blogid", Cascade = ManyRelationCascadeEnum.All,Lazy=true)]

http://www.cnblogs.com/xusion/articles/2779265.html

 

Many-Many特性 [HasAndBelongsToMany(typeof(Community), Table = "Blog_Community",ColumnKey = "blogid",ColumnRef = "communityid"  )]

http://www.cnblogs.com/xusion/articles/2779268.html

 

 

posted on 2012-11-20 16:47  一个石头  阅读(97)  评论(0)    收藏  举报