NHibernate
ChesterQin
improve step by step
展开
-
It will cause a new session when you use lazy loading collection, and the collection will assicated with the new session and the
<br />It will cause a new session when you use lazy loading collection, and the collection will assicated with the new session and the current session.<br /> <br /> <br />NHibernate 2.1.原创 2010-06-09 14:16:00 · 583 阅读 · 0 评论 -
How to bind a GridView to a list of multiple types? NHibernate proxy causing problems with databinding [From stack overflow]
NHibernate proxy causing problems with databindingI have a gridview that is bound to the result from an nhibernate query. If the first item in the list is edited the following exception is thrown:System.Reflection.TargetException: Object does not match转载 2010-10-12 14:37:00 · 720 阅读 · 0 评论 -
Big impact when set property type in-properly
<br />In sqlserver DB, for the string, we have types: NVARCHR, VARCHAR.<br />In mapping class, if you use default set the type to "string" but the column type is varchar in DB, that will cause a transfer in DB side when searching comparing, if unfortunatel原创 2010-12-22 17:09:00 · 518 阅读 · 0 评论 -
Combating the Select N + 1 Problem In NHibernate
<br />Source link: http://ayende.com/Blog/archive/2006/05/02/CombatingTheSelectN1ProblemInNHibernate.aspx<br /> <br />Combating the Select N + 1 Problem In NHibernate<br /> Homeprevious: The Prison Domain Modelnext: That Boring UI...<br />Using an O/RM can转载 2011-04-06 23:55:00 · 523 阅读 · 0 评论 -
Using NHibernate with Multiple Databases
http://www.codeproject.com/KB/aspnet/NHibernateMultipleDBs.aspxIntroduction<br />A previous CodeProject article described using NHibernate with ASP.NET; it offered guidelines for communicating with a single database. But, it is sometimes necessary to commu转载 2011-04-07 00:09:00 · 1275 阅读 · 0 评论 -
Running NHibernate3.3&CouchBase successfully
将NHibernate升级到3.3,并使用最新的Couchbase,二级缓存不起作用,该文章可解决这个问题,我自己实验已经配置好可用nhibernate-caches-couchbase2nd level caching provider for NHibernate using Couchbase.This provider is a port of the Enyim.Ca转载 2013-03-20 11:55:23 · 1200 阅读 · 0 评论 -
未能加载文件或程序集“NHibernate.ByteCode.Castle”或它的某一个依赖项。系统找不到指定的文件
将NHibernate更新到3.3后会报错:未能加载文件或程序集“NHibernate.ByteCode.Castle”或它的某一个依赖项。系统找不到指定的文件。最新版本的NHibernate内置了bytecode的provider,所以不再需要单独提供该provider,解决这个问题只需将该项配置移除 NHibernate.ByteCode.Castle.ProxyFac原创 2013-03-20 11:49:00 · 2040 阅读 · 0 评论 -
NHibernate OneToOne 映射下使用延迟加载
环境:NHibernate 3.3在NH下,one to one映射时目前不能支持延迟加载,即:假设A为主表,B为副表,B中有外键指向A,使用OneToOne将B映射进Class A,则在加载A时会单独再加载与之关联的B;例如如果是:(From A).SetMaxResults(5).List();则会产生6条SQL语句,一句是 select top 5 * from A另原创 2013-03-24 21:02:55 · 1912 阅读 · 0 评论