Skip to content

useGeneratedKeys does work unexpected after upgrading from 3.4.4 to 3.5.6 #2201

@grobmeier

Description

@grobmeier

MyBatis version

Upgrading from 3.4.4 to 3.5.6, Spring version 1.3.1 to 2.0.6.

Database vendor and version

MySQL: JDBC Driver 8.0.15 and also 8.0.22.

Test case or example project

This code:

    @Insert("INSERT INTO user SET activationkey =  #{activationkey}, email =  #{email} ")
    @Options(useGeneratedKeys = true, keyColumn = "id")
    void insertUser(User user);

runs as expected with 3.4.4 and with Spring 1.3.1.
But with 3.5.6 and Spring 2.0.6 the generated key is no longer added to the User object.

I know there was a breaking change around keyColumn, but that was always set like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions