Closed
Description
MyBatis version
3.5.11 via mybatis-spring-boot-starter 2.3.0
Regression from 3.5.9 via mybatis-spring-boot-starter 2.2.2
Database vendor and version
PostgreSQL 14.x
Test case or example project
public record ResultType(
String value) {
}
<resultMap id="resultTypeMap" type="ResultType">
<constructor>
<arg column="value" name="value" />
</constructor>
</resultMap>
<select id="getResult" resultMap="resultTypeMap">
SELECT 'foobar' AS value;
</select>
Steps to reproduce
- Create a
record
type and map to it via aconstructor
resultMap
, as above.
Expected result
The default record
constructor would be found and linked.
Actual result
The default record
constructor is not found due to the java type of the ResultMapping
being java.lang.Object
.
Workaround
Define the javaType
for the constructor args. This was not necessary in version 3.5.9.