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: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.