MapperScan excludeFilters support

25 views
Skip to first unread message

Xyz Amos

unread,
Apr 10, 2017, 5:53:40 AM4/10/17
to mybatis-user
could `@MapperScan` annotaion support `excludeFilter`?
I write a base abstract mapper and put it into my mapper package, but i don't want it to be scanned as a bean.
I can only figure out three solutions:
  1.move the abstract mapper to another package, which seems stupid
  2.similar to 1,put the abstract mapper  to `mapper.base` and others to `mapper.whateverlelse`
  2.add`@Component` or `@Repository` to every mapper rather than using `@MapperScan` automatically

Kazuki Shimizu

unread,
Apr 10, 2017, 1:18:53 PM4/10/17
to mybatis-user
> could `@MapperScan` annotaion support `excludeFilter`?
Not supported.

The MyBatis provide @Mapper annotation for marking mapper interface. You can specify it at every mapper files, and specify {@MapperScan(annotationClass=Mapper.class)} at config file.
The @Mapper annotation is used to scan mapper interface in mybatis-spring-boot-autoconfigure already.

Thanks.

Xyz Amos

unread,
Apr 10, 2017, 9:52:59 PM4/10/17
to mybati...@googlegroups.com
thanks

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/65IypFzVdJo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mybatis-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages