Indexed list with attributes

11 views
Skip to first unread message

Michal Cicatka

unread,
Dec 24, 2021, 11:07:18 AM12/24/21
to nhusers
I have a list of items which includes null and I would like to map it to my DB using the  NHibernate.Mapping.Attributes. This is my source code but it does not work. What am I doing wrong? 

A little background: I have a Project class that contains List of "CPTItem". The "ItemIndex" is a column in the database which should be used to retrieve ordered list with null gaps. My BussinessBindingList is a class that implements IBindingList interface.

[List(0, Table = "CPT_Items", Cascade = "all-delete-orphan", CollectionTypeType = typeof(BusinessBindingList<CPTItem>))]
[Key(1, Column = "ProjectID")]
[ListIndex(2, Column = "ItemIndex")]
[OneToMany(3, ClassType = typeof(CPTItem))]
public virtual IBindingList< CPTItem> ColonyPicks { get; protected set; }
Reply all
Reply to author
Forward
0 new messages