<select id="testSql" parameterType="ParameterInfo" resultType="ResultDataInfo">
SELECT
col1,
col2,
col3
FROM TEST_TABLE
WHERE REG_DATE >= date_add(now(), INTERVAL -1 DAY)
AND co1 = #{col1}
LIMIT 10
</select>
I usually map the resultType or parameterType by passing the vo.
Is it possible to use inner class for resultType or parameterType in Mybatis?
mybatis inner-classes
It's possible.
However, I think the inner class should be declared static.
package namespace.to
public class Outer {
public static class InnerA {
//...
}
public static class InnerB {
//...
}
//...
}
If it's the same as above, you can write it as follows.
<select id="testSql" parameterType="namespace.to.Outer$InnerA" resultType="namespace.to.Outer$InnerB">
<!-- ... -->
</select>
When you write Inner class, you can express it by writing $ instead of punctuation (.).
© 2024 OneMinuteCode. All rights reserved.