-->
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.  [ 2 posts ] 
Author Message
 Post subject: Join table with reference to a Join table
PostPosted: Tue Jun 15, 2010 11:29 am 
Beginner
Beginner

Joined: Tue Apr 19, 2005 9:39 am
Posts: 45
I am going to try my best to explain what I am working on; sorry if this does not come out comprehensable.

The main tables:
    Part
    Feature
    Attribute

The join tables:
    FeatureAttribute {many-to-many join table between Feature and Attribute, with no additional data attributes}
    ConfiguredFeature {many-to-many table between FeatureAttribute and Part, with additional data attributes}

The model:
A Feature can have many Attributes, likewise an Attribute can be used within many Features (many-to-many). A Part can have many FeatureAttributes assigned to it with additional information (value, granted). This is the ConfiguredFeature table.

I did not create a mapped class for FeatureAttribute because there was no additional data required. This is mapped in Feature.hbm.xml as follows:

Code:
<!--  The Attributes for 'this' Feature. -->
<set name="attributes" table="FeatureAttr" cascade="save-update" lazy="false">
   <key column="featureId"/>
   <many-to-many class="Attribute" column="attributeId"/>
</set>


My question is how do I map ConfiguredFeature to Part, or am I way off. Basically I want to assign a value to the Attribute only when it is assigned to a Part.


Top
 Profile  
 
 Post subject: Re: Join table with reference to a Join table
PostPosted: Thu Jun 17, 2010 11:27 am 
Beginner
Beginner

Joined: Tue Apr 19, 2005 9:39 am
Posts: 45
I was just wondering if there is anything I could add that might clear up the question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.