Hi,
I have three tables:
Province
id, name
Holiday_pay_Rule
id,name
Province_Holiday_Rule
id, province_id, holiday_rule_id, value
Now, I have Province and Holiday Rule both persisted. What is the best way to map it so that I can get the values? Essentially, I need a list of rules, but I need the values associated with the rule for this province. (I will always grab the province objects and then check the rules).
I tried :
Code:
<map
name="holidayPayRuleValues"
lazy="true"
inverse="true"
table="province_holiday_rule"
>
<key column="province_id"/>
<index column="holiday_pay_rule_id" type="int"/>
<element column="value" type="string"/>
</map>
<map
name="holidayPayRules"
lazy="true"
inverse="true"
table="province_holiday_rule"
>
<key column="province_id"/>
<index column="holiday_pay_rule_id" type="int"/>
<many-to-many column="holiday_pay_rule_id" class="com.cc.tss.HolidayPayRule"/>
</map>
But it complains that I mapped holiday_pay_rule_id twice. Help!