These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Confirmation of need for Bidirectional Many-to-many lists
PostPosted: Fri Dec 19, 2008 8:23 am 
Newbie

Joined: Fri Dec 19, 2008 8:13 am
Posts: 3
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 22, 2008 4:59 am 
Newbie

Joined: Mon Dec 22, 2008 4:35 am
Posts: 1
I had a similar problem a couple of months back. I couldn't get my head around the problem and eventually had to move onto a different solution.

I've be grateful if anyone could shed some light as I was racking my brains out for ages!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2009 10:49 am 
Newbie

Joined: Fri Dec 19, 2008 8:13 am
Posts: 3
Hi,

Been looking at this problem over Xmas, and still cannot resolve the issue. I am wondering whether I should not use many-to-many relationships, and instead introduce extra index properties and use order-by to sort elements in each collection. This would however make the solution messy, which I am obviously not happy about.

Any other ideas?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.