摘要: Refer to http://stackoverflow.com/questions/97197/what-is-the-n1-selects-problemRefer to http://www.realsolve.co.uk/site/tech/hib-tip-pitfall.php?name=why-lazyProblem:Suppose we have a class Leaf with a many-to-one relationship with Tree. In other words, one Tree can be related to many Leafs. Lets s 阅读全文
posted @ 2012-09-06 16:27 webglcn 阅读(237) 评论(0) 推荐(0)
摘要: <?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection"> <class name="Course" table="Course"> <id name=" 阅读全文
posted @ 2012-09-06 14:37 webglcn 阅读(150) 评论(0) 推荐(0)
摘要: <?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection"> <class name="Staff" table="Staff"> <id name="I 阅读全文
posted @ 2012-09-06 14:33 webglcn 阅读(133) 评论(0) 推荐(0)
摘要: <?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection"> <class name="Tree" table="Tree"> <id name="Id& 阅读全文
posted @ 2012-09-06 14:27 webglcn 阅读(136) 评论(0) 推荐(0)
摘要: <?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection"> <class name="Cup" table="Cup"> <id name="Id&qu 阅读全文
posted @ 2012-09-06 14:21 webglcn 阅读(180) 评论(0) 推荐(0)
摘要: <?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection"> <class name="Product" table="Product"> <id name=&qu 阅读全文
posted @ 2012-09-06 14:15 webglcn 阅读(146) 评论(0) 推荐(0)
摘要: Refer to http://www.cnblogs.com/liubiaocai/archive/2011/09/12/2173991.html1、NH的延迟加载的意思就是:你访问了属性(就是点一个属性出来,除了ID之外)就生成sql到数据库加载2、NH的在延迟加载有2个方面,一个是延迟加载类的;另外一个是延迟加载集合的3、NH的类延迟加载仅对于使用session的Load方法时才有效【如果使用Get的话,不管类级别的lazy怎么配置,始终会生成一条加载类本身的sql】4、NH的集合延迟加载,对于session的Get和Load方法都是有效的5、如果把类级别的lazy设置为false,那么 阅读全文
posted @ 2012-09-06 10:46 webglcn 阅读(222) 评论(0) 推荐(0)
摘要: Refer to http://www.cnblogs.com/netgarden/archive/2006/11/23/570129.htmlEvery data access strategy after server-side cursors has had as a goal minimizing the length of time an application holds open a connection, and NHibernate is no different. Therefore, having a static Session sitting around open 阅读全文
posted @ 2012-09-06 10:28 webglcn 阅读(201) 评论(0) 推荐(0)