随笔分类 -  ORM

摘要:1. 自定义非受管实体类namespace IOT{ public class CustomerProjection{ public int ID = 0; public string Name = ""; public CustomerProjection(int id, string name){ ID = id; Name = name; } }}2. 在实体类属性添加对自定义非受管实体类的引入[Imprt(typeof(IOT.CustomerProjection), "CustomerProjection")][ActiveRecord... 阅读全文
posted @ 2011-12-13 17:33 不搽雪花膏 阅读(459) 评论(0) 推荐(0)
摘要:1 表列如果你的列名是数据库的保留字,在Property中用"`"声明列名[Property("`User`")]public String User{ get { return _user; } set { _user = value; }}不要使用Status做列名,它是NHibernate的保留字,否则ActiveRecord会抛异常:Ambiguous column name 'Statu... 阅读全文
posted @ 2010-08-08 20:36 不搽雪花膏 阅读(449) 评论(0) 推荐(0)
摘要:Hibernate配置参数示例 阅读全文
posted @ 2008-11-18 10:38 不搽雪花膏 阅读(693) 评论(0) 推荐(0)