代码改变世界

NHibernate In Action CH2 Hello NHibernate

2011-07-16 16:20 by 一一九九, 193 阅读, 0 推荐, 收藏, 编辑
摘要:看了一下还是07年写的Blog,想来看NHibernate已经断断续续将近两年了。写的有些凌乱,整理一下。 记录了建立NHibernate Project的步骤: (一) Set up the Project,add assembly reference 添加引用。在Project中添加Reference: NHibernate.dll Using NHibernate, NHibernate.C... 阅读全文

Convert Object to int

2011-07-14 23:14 by 一一九九, 2341 阅读, 0 推荐, 收藏, 编辑
摘要:在调试代码的时候碰到了这样的一行代码: int a = (int)(Object(double)); 此时报错,表明是InvalideCastException。 当时表示很奇怪: 为什么 int a = (int)(doble type)) 能够通过呢? 网上搜了一下,StackOverFlow上有个帖子: http://stackoverflow.com/questions/745172/be... 阅读全文

Nhibernate Beginner ch12 odds and ends

2011-07-12 01:47 by 一一九九, 211 阅读, 0 推荐, 收藏, 编辑
摘要:Unit of work and burrow Unit Of work pattern: http://www.martinfowler.com/eaacatalog/unitOfWork.html when you’re pulling data in and out of a databased, it’s important to keep track of what you’ver ... 阅读全文

NHibeginner Ch8 writing Queries

2011-07-10 17:21 by 一一九九, 144 阅读, 0 推荐, 收藏, 编辑
摘要:Definitely one of the strongest reasons for switching to NHibernate has to be the way that you query data . The basic data access object in order for out data access objects to be effective for our u... 阅读全文

NHbernate begginner ch7 Configuration

2011-07-09 22:39 by 一一九九, 148 阅读, 0 推荐, 收藏, 编辑
摘要:Configuration is simply a way to provide NHibernate with the information it requires to connect to the database map our classes, and generally provide us with all of its benefits. The basic of configu... 阅读全文

Nhibernate Beginner ch6 I am a logger

2011-07-09 11:57 by 一一九九, 191 阅读, 0 推荐, 收藏, 编辑
摘要:log4net has three major objects that we need to be concerned with – the log manager, loggers, and appenders. Imagine that log4net is a big bucket into which we throw all of the items we want to log o... 阅读全文

NHibernate beginner ch5 todo:

2011-07-05 07:16 by 一一九九, 176 阅读, 0 推荐, 收藏, 编辑
摘要:todo: cfg.AddAssembly(typeof(Address).AssemblyQualifiedName); 为啥会报错? cfg.AddAssembly(typeof(Address).AssemblyQualifiedName); 在NHibernate的源码中,这句话是这样的: public Configuration AddAssembly(string assemblyN... 阅读全文

NHibernate Beginner ch5

2011-07-04 18:20 by 一一九九, 324 阅读, 0 推荐, 收藏, 编辑
摘要:Using what we have already learned, NHibernate knows enough about our data structure and our objects. now it’s time to let NHibernate connect to the database. Think of an NHibernate session as an abst... 阅读全文

NHibernate Begginner Ch4

2011-07-03 22:13 by 一一九九, 218 阅读, 0 推荐, 收藏, 编辑
摘要:Our next major hurdle in the implementation of NHibernate is database mapping. In the last few chapters, we learned how to create tables to hold our data and how to create classes to hold that data in... 阅读全文

NHibernate Begginner Ch3

2011-07-02 19:46 by 一一九九, 184 阅读, 0 推荐, 收藏, 编辑
摘要:NHibernate Begginner Ch3 one of the greatest things that NHibernate brings to us is the ability to work directly with objects instead of having to deal with DataSets or DataReaders. Before we can use... 阅读全文

NHibernate Beginnger ch2

2011-07-02 18:05 by 一一九九, 174 阅读, 0 推荐, 收藏, 编辑
摘要:NHibernate Beginnger ch2 Technorati 标签: NHibernate Like the foundataion of a building, the structure of your database forms the base for your entire application. if you take a little care and build it... 阅读全文