NHibernate query against the key field of a dictionary (map)

后端 未结 1 1130
独厮守ぢ
独厮守ぢ 2021-01-25 04:46

I have an object model where a Calendar object has an IDictionary called UserPermissions, where MembershipUser is an object, and Perms

相关标签:
1条回答
  • 2021-01-25 05:24

    Just trying to do this myself and it looks like this can be done with HQL but not the Criteria API.

    https://nhibernate.jira.com/browse/NH-1795

    To do it in HQL:

    http://ayende.com/Blog/archive/2009/06/03/nhibernate-mapping-ndash-ltmapgt.aspx

    Specifically look for Ayende's comment:

    It is something like: select 1 from Profile p join p.Entries e where index(e) = 'HasCats' and e = 'true'

    0 讨论(0)
提交回复
热议问题