set a map to a parameterclass in iBatis

2.9k Views Asked by At

what's the difference between setting a map and setting an object to a parameterClass in iBatis?

means,

<update id="update" parameterClass="map">
    UPDATE city 
    SET province_id = #province_id#
    WHERE id = #id# 
</update>

and

<update id="update" parameterClass="City">
    UPDATE city 
    SET province_id = #province_id#
    WHERE id = #id# 
</update>

?

I could not find any difference when I tested both.

I really want to set all with "map", but scared ...

1

There are 1 best solutions below

1
On

"map" in parameterClass="map" simply is an alias for "java.util.Map". Don't you think it is simply because your City class implements the Map interface?