李春良

导航

2011年6月21日 #

NHibernate中IUserType的使用

摘要: 在NHibernate的使用中有可能遇到无法自动映射的类型,这个时候就需要自己定义类型了,NHibernate提供了IUserType来自定义新的类型。这里以一个可空的时间类型为例:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingNHibernate.UserTypes;usingNHibernate.SqlTypes;usingSystem.Data.OracleClient;namespaceHHSoft.LandSupply.DataEntity.NHibernateTy 阅读全文

posted @ 2011-06-21 11:20 李春良 阅读(651) 评论(2) 推荐(0) 编辑

NHibernate one-to-many 插入

摘要: 最近刚刚接触NHibernate,遇到了one-to-many关系的实体,在更新的时候总是报 “此 OracleParameterCollection 的 Count=10 的索引 10 无效。”的错误,在网上找了好久终于找到答案,特此记录一下。两个实体类:LANDSUPPLY_PARCELLANDusingSystem;usingIesi.Collections;usingSystem.Collections.Generic;usingIesi.Collections.Generic;usingHHSoft.LandSupply.DataEntity.SystemManager;namesp 阅读全文

posted @ 2011-06-21 11:10 李春良 阅读(901) 评论(0) 推荐(0) 编辑