NHibernate Criteria 留下反连接/子查询混乱
我将用 NHibernate 远远超出我的舒适区这一事实作为序言,因此这可能比我想象的要简单得多。
我有一个 users
表和一个映射到 user
和 event
对象的 events
表。
我的 event
对象引用单个 user
对象。
我有一个属性,我将其保留在 LastActivityTimeStamp 的 user
对象上。
我的 event
对象上有与 EventType 和 Success 相关的属性。
要确定“在线”用户列表,我需要收集 LastActivityTimeStamp 大于先前计算的 cutoff
值的所有用户对象,其最后一次活动位于 < code>events 表不是成功的“注销”事件类型。
我该如何写这个标准?
I'll preface this with the fact that NHibernate is well out of my comfort zone, so this may be much simpler than I'm making it out to be.
I have a users
table and an events
table mapped to user
and event
objects.
My event
objects reference a singular user
object.
I have a property that I persist on my user
object for LastActivityTimeStamp.
I have properties on my event
object related to EventType and Success.
To determine a list of users that are "online", I need to collect all user objects with a LastActivityTimeStamp greater than a previously calculated cutoff
value, whose last activity in the events
table was not a successful "Logoff" event type.
How would I write this criteria?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试调整这个
try to tweak this