Hi,
I am currently trying to model a relationship between our business entities.
We have two main business entities: Chapter and LineItem where a Chapter has a set of LineItems.
However, this is further broken down to provide versioning.
Therefore, a Chapter has a LIST (not bag!!) of ChapterVersions.
A LineItem has a LIST of LineItemVersions.
Now, the relationship between Chapter and LineItem becomes:
A ChapterVersion needs a LIST of LineItemVersions (the versions created in the scope of that ChapterVersion).
A LineItemVersion needs a List of ChapterVersions (the versions of the chapter that a LineItemVersion belongs to).
I am trying to model this in the database using a table:
table CHAPTER_LINEITEM_VERSIONS
{
chapter_version_id int,
lineitem_version_id int,
chapter_version_order int,
lineitem_version_order int
}
The mappings worked fine when modelling this using bidirectional bag mappings, but I am struggling converting the bags to lists. The error states it can't find column lineitem_version_order, but it is trying to find this in the LINEITEM_VERSIONS table rather than this link table.
Is this the best way of modelling this releationship, and if so, any advise?
Cheers
|