I have the two following tables (SQL Server):
**IndexValues**
IdIndexValue int (PK)
Value varchar(2000)
IdIndex int (FK for Table Indexes)
IdDocument int (FK for Table Documents)
**IndexValuesLists**
IdIndexValueList int (PK)
IdIndexValue int (PK with IdIndexValueList, FK for Table Indexes)
Explaining a little, the second table groups items from the first table. A document can have various "group items" at the second table. I have the following BusinessObjects classes:
IndexValue {
int Id;
string Value;
Document Document;
Index Index;
}
IndexValueList {
int Id;
Document Document;
List<List<IndexValue>> IndexesValues;
}
I don't know how to do the mapping for this last property. How to do that on the hbm.xml ?
EDIT: Making an example for explaining more what I need:
IndexValues rows:
IdIndexValue / Value / IdIndex / IdDocument
1, "A", 10, 500
2, "Circle", 11, 500
3, "John", 12, 500
4, "B", 10, 500
5, "Square", 11, 500
6, "Mary", 12, 500
======================
IndexValuesLists rows:
IdIndexValueList / IdIndexValue
1, 1
1, 2
1, 3
2, 4
2, 5
2, 6