ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: regresssion (?) in beta 9: No automapping if some properties are explicitly mapped
Date Tue, 02 Feb 2010 15:47:10 GMT
Sorry, this was a change. See the documentation for <settings> in the user
guide. Unfortunately I poorly advertised the change.

You can now configure the setting autoMappingBehavior="NONE|PARTIAL|FULL"

NONE and FULL are pretty self explanatory.  FULL is how it worked in
previous betas.  However, the new default is PARTIAL, which means that
automapping only happens on simple, flat queries.  If you use associations
or collections, PARTIAL mode will not automap fields.

The primary reason was that I found when doing complex joins, it was hard to
tell where the value would end up, especially in cases where the column
matched multiple property names in parent and child objects.  So I chose
PARTIAL to be a happy medium between simplicity and expressiveness.  But if
you're confident that your unit testing will deal with any uncertainty, then
feel free to set it to FULL.  Otherwise, I suggest sticking with PARTIAL.
There is also an obvious performance benefit to setting it to PARTIAL or
NONE.

Cheers,
Clinton

On Tue, Feb 2, 2010 at 7:26 AM, Stephen Friedrich <
stephen.friedrich@fortis-it.eu> wrote:

>  I wonder if this was an intentional change:
>
> My mapping config looks like this:
>
>
>
>     <resultMap id="partSetMap" type="PartSetDto">
>
>         <id property="id" column="id"/>
>
>         <collection property="parts" ofType=" PartDto">
>
>             <result column="part_id" property="id" javaType="Long"/>
>
>             <result column="serial_no" property="serialNo"
> javaType="String"/>
>
>             <result column="is_reserved" property="isReserved"
> javaType="boolean"/>
>
>         </collection>
>
>     </resultMap>
>
>
>
>     <select id="selectPage" resultMap="partSetMap">
>
>         …
>
>
>
> PartSetDto has lots of other properties than “id”.
>
> In beta 8 those were automatically filled by naming convention.
>
> In beta 9 all other fields are empty.
>
>
>

Mime
View raw message