emacarron / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

Component Scan for Mappers #130

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be great to have an annotation similar to @Repository that enables 
mapper scanning, so that mappers do not need to be registered in appContext.xml 
or config clasess.

Original issue reported on code.google.com by eduardo.macarron on 6 Oct 2010 at 7:39

GoogleCodeExporter commented 9 years ago

Original comment by eduardo.macarron on 6 Oct 2010 at 7:41

GoogleCodeExporter commented 9 years ago
I tried to use ComponentScanBeanDefinitionParser (context:component-scan) that 
is customizable, but it does not load interfaces:
"Ignored because not a concrete top-level class: file 
[D:\Workspace\MVN\mybatis-spring\target\test-classes\sample\UserMapper.class]"

Fotunately I got to a blog of Tomáš Piňos and saw he used a 
BeanDefinitionRegistryPostProcessor. This bean runs after beans are 
instantiated and is able to register new bean definitions. And seems it does 
the job! :)

Original comment by eduardo.macarron on 13 Oct 2010 at 1:11

GoogleCodeExporter commented 9 years ago

Original comment by eduardo.macarron on 13 Oct 2010 at 10:13

GoogleCodeExporter commented 9 years ago

Original comment by eduardo.macarron on 1 Jan 2011 at 4:39