当映射丢失时,nhibernate QueryOver 不会抛出异常
谁能解释一下当没有使用类的映射时 nHibernate QueryOver 不抛出异常背后的想法是什么?假设我有一个 FakeClass 类并且没有定义映射,下面的代码执行时没有异常。
var result = session.QueryOver<FakeClass>()
.Where(x => x.Name == "SomeName").List();
Can anyone explain what's the idea behind nHibernate QueryOver not throwing exception when there is no mapping for used class? Let's say i have a FakeClass class and no mapping defined, code below executes without exception.
var result = session.QueryOver<FakeClass>()
.Where(x => x.Name == "SomeName").List();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个报告的错误:https://nhibernate.jira.com/browse/NH-2829
希望它不会像这样结束:https://nhibernate.jira.com/browse/NH-2183
well it's a reported bug: https://nhibernate.jira.com/browse/NH-2829
hope it won't end like this : https://nhibernate.jira.com/browse/NH-2183
FakeClass 是否作为数据库中的表存在?如果是这样,我认为 Fluent 的自动映射功能会按设计映射到它。
Does FakeClass exist as a table in the database? If so, i would think that Fluent's automapping feature would map to it as designed.