摘要: Refer to http://www.cnblogs.com/tyb1222/archive/2012/06/18/NHibernate-Inverse-Cascade.html由测试六、测试七可知:对于删除与父类之间的关系时,all-delete-orphan会将孤儿删除(orphan意为:孤儿),而all不会删除,而是将与父关联的外键字段设置为null。 阅读全文
posted @ 2012-09-10 10:44 webglcn 阅读(138) 评论(0) 推荐(0)
摘要: WCF doesn't support static method by design.Refer to http://www.codeproject.com/Articles/89858/WCF-Concurrency-Single-Multiple-and-Reentrant-andmaxConcurrentCalls - Calls in excess of the limit are queued. refer to msdn http://msdn.microsoft.com/en-us/library/ms731379.aspx 阅读全文
posted @ 2012-09-10 09:52 webglcn 阅读(184) 评论(0) 推荐(0)
摘要: 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 阅读(134) 评论(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 阅读(137) 评论(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 阅读(147) 评论(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 阅读(223) 评论(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 阅读(202) 评论(0) 推荐(0)