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 declared class's package as base package if not present base packages on @MapperScan #438

Merged
merged 5 commits into from
Dec 13, 2019

Conversation

tacoo
Copy link
Contributor

@tacoo tacoo commented Dec 12, 2019

When I am working on gradle multi project, I often use below config class to import sub modules. ComponentScan uses declared class's package if the basePackages attribute is not present. However, MapperScan will not work like ComponentScan. I think this is obvious case and MapperScan should treat like ComponentScan

package a;

@Configuration
@ComponentScan
@MapperScan("a")
public class xx....

…nnotation if basePackages attrubute is not present
@tacoo tacoo changed the title Use declared class MapperScan Use declared class's package as default base package when basePackages attribute is not present in MapperScan Dec 12, 2019
@kazuki43zoo kazuki43zoo self-assigned this Dec 12, 2019
@kazuki43zoo kazuki43zoo added the enhancement Improve a feature or add a new feature label Dec 12, 2019
@kazuki43zoo kazuki43zoo added this to the 2.0.4 milestone Dec 12, 2019
Copy link
Member

@kazuki43zoo kazuki43zoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tacoo Thanks for your contributing! I've add some comments. Please check.

@kazuki43zoo
Copy link
Member

@tacoo Could you add an explanation for this change on the documentation for @MapperScan ?

@kazuki43zoo kazuki43zoo changed the title Use declared class's package as default base package when basePackages attribute is not present in MapperScan Use declared class's package as base package if not present base packages on @MapperScan Dec 12, 2019
@kazuki43zoo kazuki43zoo merged commit 7da2d39 into mybatis:master Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve a feature or add a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants