C# 如何在nhibernate中映射有序列表?
我有两个类:C# 如何在nhibernate中映射有序列表?,c#,database,nhibernate,C#,Database,Nhibernate,我有两个类:container,它包含元素的动态有序列表 我应该使用什么样的C#collection 你能给我推荐什么样的数据库模式吗 我应该如何配置nhibernate映射 TIANHibernate支持System.collections.SortedList和Iesi.collections.SortedSet实现的集合。必须在映射文件中指定比较器: <set name="Aliases" table="person_aliases" sort="natural"> &
container
,它包含元素的动态有序列表
我应该使用什么样的C#collection
你能给我推荐什么样的数据库模式吗
我应该如何配置nhibernate映射
TIANHibernate支持System.collections.SortedList和Iesi.collections.SortedSet实现的集合。必须在映射文件中指定比较器:
<set name="Aliases" table="person_aliases" sort="natural">
<key column="person"/>
<element column="name" type="String"/>
</set>
<map name="Holidays" sort="My.Custom.HolidayComparer, MyAssembly" lazy="true">
<key column="year_id"/>
<index column="hol_name" type="String"/>
<element column="hol_date" type="Date"/>
</map>
资料来源:
<set name="Aliases" table="person_aliases" order-by="name asc">
<key column="person"/>
<element column="name" type="String"/>
</set>
<map name="Holidays" order-by="hol_date, hol_name" lazy="true">
<key column="year_id"/>
<index column="hol_name" type="String"/>
<element column="hol_date type="Date"/>
</map>
sortedUsers = s.Filter( group.Users, "order by this.Name" );