How to use autoMapping with discriminators.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use autoMapping with discriminators.

Sangpil BYUN
Hi!

Can I use `autoMapping` with `discriminator` without set autoMappingBehaver to 'FULL'.

Like this..
<resultMap id="vehicleResult" type="Vehicle" autoMapping=true>
  <id property="id" column="id" />
  <discriminator javaType="int" column="vehicle_type">
    <case value="1" resultType="carResult" autoMapping=true />
    <case value="2" resultType="truckResult" autoMapping=true />
    <case value="3" resultType="vanResult" autoMapping=true />
    <case value="4" resultType="suvResult" autoMapping=true />
  </discriminator>
</resultMap>


--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to use autoMapping with discriminators.

Iwao AVE!
Hi,

Have you tried setting autoMappingBehavior="PARTIAL" ?
It should be sufficient if 'resultType' is specified in '<case />' elements.

Regards,
Iwao

2016-09-08 11:31 GMT+09:00 Sangpil BYUN <[hidden email]>:
Hi!

Can I use `autoMapping` with `discriminator` without set autoMappingBehaver to 'FULL'.

Like this..
<resultMap id="vehicleResult" type="Vehicle" autoMapping=true>
  <id property="id" column="id" />
  <discriminator javaType="int" column="vehicle_type">
    <case value="1" resultType="carResult" autoMapping=true />
    <case value="2" resultType="truckResult" autoMapping=true />
    <case value="3" resultType="vanResult" autoMapping=true />
    <case value="4" resultType="suvResult" autoMapping=true />
  </discriminator>
</resultMap>


--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.