I am trying to implement a dynamic component that has a bag of dynamic classes.
My mapping (stripped to the minimum) looks like
Code:
<dynamic-component name="fields">
<bag name="multi" inverse="true">
<key column="clientno" />
<one-to-many class="EntityMT" />
</bag>
</dynamic-component>
<dynamic-class entity-name="EntityMT">
<composite-id name="clientNo" class = "inform.orm.entity.ClientNo" >
<key-property name="clientNo"/>
</composite-id>
<property name="description" column="description" type="string"/
</dynamic-class>
Everthing appears to work when I load the component from the database. There is now a Map which contains a key element pair with a key of “multi” and a list as a element.
When I access the list the following SQL runs correctly selecting the required rows from the data base
Code:
select multi0_.clientno as clientno__, multi0_.clientNo as clientNo__, multi0_.clientNo as clientNo0_, multi0_.description as descript2_17_0 from EntityMT multi0_ where multi0_.clientno=?
The list contains the correct number of elements,
but all the elements point to the same map. This map represents the first row of data. Where are the other rows of data?
I missing something?