I have this entity association.
1 Customer has * Budget.
In my customer class, I have the attribute budgets that is a List and in my Budget class I have the attribute customer. So, this is a bidirection one to may associtation between two entitys.
How can I map this? I alread tryed to use idbag, but this doesn't work. In the hibernate manual and the Hibernate in action, there are examples of this case only using <set>. Can I make this using a List in java code? Should I use idbag? I don't need to preserve the index of the list.
I alread tryed this mapping below, but this doesn't work:
Code:
<idbag name="orcamentos" lazy="true" inverse="true" cascade="save-update">
<key column="CLIENTE_ID" not-null="true" />
<one-to-many class="src.model.Orcamento" />
</idbag>