有两个同名的Mapper:
package com.clear.ims4.business.material.program.layout;
@Mapper
public interface LayoutRepository {
}
package com.clear.ims4.business.material.widget.layout;
@Mapper
public interface LayoutRepository {
}
一个属于program的layout,一个属于widget的layout
启动时会报错:
org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'layoutRepository' for bean class [com.clear.ims4.business.material.widget.layout.LayoutRepository] conflicts with existing, non-compatible bean definition of same name and class [com.clear.ims4.business.material.program.layout.LayoutRepository]
解决方案:
加@Repository
@Repository("ProgramLayoutRepository")
@Repository("WidgetLayoutRepository")