Skip to content

ResultMap由于重复映射产生的全小写property,高版本映射到PO类失败 #3437

Open
@sayhi-captain

Description

@sayhi-captain

问题复现

<resultMap id="BaseResultMap" type="com.xxx.Student">
    <id column="student_id", jdbcType="BIGINT" property="studentId">
    <result column="student_name", jdbcType="VARCHAR" property="studentName">
</resultMap>

<select id="query" resultMap="BaseResultMap">
    select 
    student_id as studentId,
    student_name as studentName
    from student where deleted = 0
</select>
@Data
public class Student {
    private Long studentId;
    private String studentName;
}

pom版本

老项目
mybatis: 3.4.1

查询出的column:studentidstudentname,查询正常映射到Student

新项目
mybatis: 3.5.7

查询出的column:studentidstudentname,查询映射到Student,属性均为空

问题代码定位:
高版本jar包
Image

低版本无问题jar包

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions