Terry's blog

Focus on bigdata and cloud.

博客园 首页 新随笔 联系 订阅 管理
上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 77 下一页

2009年2月24日 #

摘要: 概述: 当使用Nhibernate查询表中的数据时,如果表中存在复合主键,如果没有在相应的实体类中重写Equals(),那么将会出现"Could not compile the mapping document: TestCleanSnow.JkptGlxtUser.hbm.xml".当跟踪出错的内部信息的时候会发现,内部异常为"composite-id class must overrid... 阅读全文
posted @ 2009-02-24 16:46 王晓成 阅读(2541) 评论(4) 推荐(0)

2009年2月19日 #

摘要: 概述: 在用Nhibernate查询所返回的数据为IList,而我们经常需要的却是DataSet,所以很有必要这么一个方法. 代码: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**/ /// /... 阅读全文
posted @ 2009-02-19 16:25 王晓成 阅读(1515) 评论(0) 推荐(0)

2009年2月17日 #

摘要: 概述: 当运行 session.Save(tnp);时,出现这个"Unknown entity class: TestCleanSnow.TestNhibernatePerson"这个异常. 映射文件 TestNhibernatePerson.hbm.xml如下: Code highlighting produced by Actipro CodeHighlighter ... 阅读全文
posted @ 2009-02-17 16:06 王晓成 阅读(3519) 评论(1) 推荐(0)

2009年2月16日 #

摘要: 转自官方文档:http://logging.apache.org/log4net/release/config-examples.html log4net Config Examples Overview This document presents example configurations for the built-in appenders. These configuratio... 阅读全文
posted @ 2009-02-16 17:43 王晓成 阅读(679) 评论(0) 推荐(0)

摘要: 我用的是Oracle9i,应用程序app.config的配置如下" Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> NHibernate.Dialect.MsSql2000D... 阅读全文
posted @ 2009-02-16 15:46 王晓成 阅读(2370) 评论(0) 推荐(1)

2009年2月13日 #

摘要: 主键产生器 可选项说明: 1) assigned 主键由外部程序负责生成,无需NHibernate参与。 2) hilo 通过hi/lo 算法实现的主键生成机制,需要额外的数据库表保存主 键生成历史状态。 3) seqhilo 与hilo 类似,通过hi/lo 算法实现的主键生成机制,只是主键历史 状态保存在Sequence中,适用于支持Sequence的数据库,如Oracle。 4) incr... 阅读全文
posted @ 2009-02-13 16:03 王晓成 阅读(1413) 评论(1) 推荐(1)

摘要: 1建立数据表 Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->create table Test_Increase( userid number(10) primary key, /*主键,自动增加*/ ... 阅读全文
posted @ 2009-02-13 15:51 王晓成 阅读(11671) 评论(0) 推荐(1)

摘要: 代码如下: Configuration config = new Configuration(); config.AddAssembly("TestCleanSnow"); ISessionFactory factory = config.BuildSessio... 阅读全文
posted @ 2009-02-13 11:07 王晓成 阅读(374) 评论(1) 推荐(0)

2009年2月12日 #

摘要: 在执行 session.Save(cs); 时,出现could not get next sequence value[SQL: SQL not available] Nhibernate 解决办法: 把相应XML的 改为 以上我做Oracle时出现的错误,操作sqlserver的时候应该为 . 阅读全文
posted @ 2009-02-12 15:07 王晓成 阅读(1523) 评论(0) 推荐(0)

摘要: 在加载映射文件及相应的类文件的引用时 Configuration config = new Configuration(); config.AddAssembly("TestCleanSnow"); 出现如下异常: Could not compile the mapping document: TestCleanSnow.BjkptOaxtCleanupsnow... 阅读全文
posted @ 2009-02-12 14:50 王晓成 阅读(4631) 评论(2) 推荐(0)

上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 77 下一页