What is the usage of the oftype tag in MyBatis?
The
There are two different ways to use the
- kind
<resultMap id="userResultMap" type="com.example.User">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="age" column="age" ofType="java.lang.Integer"/>
</resultMap>
In the example above, the ofType attribute in the
<resultMap id="userResultMap" type="com.example.User">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="age" column="age">
<ofType javaType="java.lang.Integer"/>
</result>
</resultMap>
In the example above, the
By using the