Hi,
I just started to use myBatis (after using Hibernate now for some years) and I really like the way to map even complex queries. But now I'm wondering how I would implement inserts/update of an object containing collections and
associations.
Example:
<resultMap id="resultMap" type="de.test.Vkprlist">
<result property="id" column="v_id" />
<result property="name" column="v_name" />
<collection property="preise" ofType="de.test.Vkpreise">
<result property="id" column="p_id" />
<result property="pzn" column="p_pzn"/>
<association property="artikel" resultMap="artikelResult" />
</collection>
</resultMap>
It seems as If I have to check what objects from the collections must be inserted or updated (maybe by checking if the id is set ?). This would require one insert/update statement for the collection, one insert/update statement for the association and one insert/update for the main object.
Is that true ?
Regards
Roger