Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MyBatis 3.5.0 inconsistent handling of keyProperty #1485

Closed
morvael opened this issue Feb 25, 2019 · 3 comments
Closed

MyBatis 3.5.0 inconsistent handling of keyProperty #1485

morvael opened this issue Feb 25, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@morvael
Copy link

morvael commented Feb 25, 2019

@Options(useGeneratedKeys = true, keyProperty = "n.id", keyColumn = "id")
int insertDataObject(@Param("n") DataObject dataObject);

In 3.5.0 keyProperty
"id" works with non-batch executor, "n.id" doesn't
"n.id" works with batch executor, "id" doesn't
"n.id" works with multiple parameters in mapper method, "id" doesn't

Please allow using "n.id" for single parameter methods with non-batch executors again. It was working before 3.5.0.

@kazuki43zoo
Copy link
Member

@morvael
Thank you for your reporting. Probably, this issue related with #1249. (This is specification changes since 3.5).

@harawata
Could you support this?

@harawata
Copy link
Member

I'll try to improve the consistency.
Thank you for the report!

@harawata harawata self-assigned this Feb 27, 2019
@harawata harawata added the bug label Feb 27, 2019
@harawata harawata added this to the 3.5.1 milestone Feb 27, 2019
@harawata
Copy link
Member

@morvael ,

It should be fixed in the latest 3.5.1-SNAPSHOT.
As it was a major rewrite, I would suggest you to verify the fix with your solution. :)

pulllock pushed a commit to pulllock/mybatis-3 that referenced this issue Oct 19, 2023
…hen using BatchExecutor.

Jdbc3KeyGenerator is fully rewritten and it now supports assigning generated keys to different parameters. See the test 'assigningMultipleKeysToDifferentParams'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants