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

Use Java 8 parameter names for constructing object post-query #896

Closed
reddyalready opened this issue Jan 13, 2017 · 4 comments
Closed

Use Java 8 parameter names for constructing object post-query #896

reddyalready opened this issue Jan 13, 2017 · 4 comments

Comments

@reddyalready
Copy link

Since JDK8 javac (with -parameters option) adds parameter names to classes during compilation, mybatis should be able to use these for object instantiation rather than relying on finding a constructor with the correct ordering of parameters.

Mybatis already uses these parameters to remove the need for @Param annotations in Mapper files, this was added in #549

Is this something that has been considered?

@reddyalready
Copy link
Author

We may need to add a @MybatisCreator annotation or similar for Mybatis to find the correct constructor in the case of multiple constructors (similar to Jackson's parameter names module https://github.com/FasterXML/jackson-modules-java8/tree/master/parameter-names)

@harawata
Copy link
Member

The same request as #721 , right?

@reddyalready
Copy link
Author

Indeed!

If you can give me pointers on where mybatis initialises objects, I should have some time in a couple of weeks to contribute (unless you get to it first, of course)

@harawata
Copy link
Member

I just started looking into it.
Let's use #721 for tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants