OK, I found out some something that seems to work but it is quite far fetched compare to a simple set (just to add a property field)
I still got some weird behavior with it:
I added this to my TRAINING mapping:
Code:
<list name="stateEffectif" lazy="false" table="STATE_EFFECTIVE_INDEX">
<key column="TRAINING_ID_FK"/>
<index column="STATE_CODE_FK"/>
<composite-element class="StateEffective">
<property name="quantity" column="QUANTITY" type="java.lang.Integer" not-null="true"/>
</composite-element>
</list>
Then I had to create a mapping for the STATE_EFFECTIVE_INDEX table (I wish I could avoid it)
Code:
<class name="" table="STATE_EFFECTIVE_INDEX">
<composite-id>
<key-property name="trainingIdFk" column="TRAINING_ID_FK" type="java.lang.Long"/>
<key-property name="stateCodeFk" column="STATE_CODE_FK" type="java.lang.String"/>
</composite-id>
<property name="quantity" column="QUANTITY" type="java.lang.Integer" not-null="true"/>
</class>
It seems to work (I only been testing loading though), but when I get my stateEffcetive list the quantity field is filled up but not the 2 other keys (composite-id).
Is there any simpler way to achieve this or is it the right way?
thanks lot for answering my newbie questions....