当映射丢失时,nhibernate QueryOver 不会抛出异常

发布于 2024-12-07 03:54:18 字数 242 浏览 4 评论 0原文

谁能解释一下当没有使用类的映射时 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

微暖i 2024-12-14 03:54:18

这是一个报告的错误: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

七分※倦醒 2024-12-14 03:54:18

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文