Hi all,
I'm encountering the following problem :
I have got 2 Entities, Client and ClientDef as follows :
Code:
<class name="Client" table="TB_CLIENT">
<id name="id" column="CLIENT_ID" type="long">
<generator class="native" />
</id>
<bag name="clientDefs" cascade="all">
<key column="CLIENT_ID" />
<one-to-many class="ClientDef"/>
</bag>
</class>
Code:
<class name="ClientDef" table="TB_CLIENT_DEF">
<id name="id" column="CLIENT_DEF_ID" type="long">
<generator class="native" />
</id>
<property name="creationDate"/>
<property name="terminationDate"/>
</class>
I am not happy with above "bag" collection, because it always carries a single element. (according to the current date, there is only one ClientDef that matches the given client).
Do you know how I can turn that collection into a simple association ? (Client -> ClientDef).
Best regards,
Michael.