MiniDao用法请教
dao类@MiniDaopublic interface MusicDao {
// @Sql("SELECT * FROM t_s_base_user where userkey='歌手'")
@ResultType(org.jeecgframework.web.system.pojo.base.TSBaseUser.class)
List<TSBaseUser> getAllSinger();
}spring-hibernate.xml<context:component-scan base-package="com.test.*.service" />
<context:component-scan base-package="com.test.*.dao" />MusicServiceImpl类@Autowired
private MusicDao musicDao;报错。如下:
No qualifying bean of type found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
官方给的文档好像有点旧。<bean class="org.jeecgframework.minidao.factory.MiniDaoBeanFactory">
<property name="packagesToScan">
<list>
<value>com.test.*.dao</value>
</list>
</property>
</bean>会报错,
Multiple annotations found at this line:
- No setter found for property 'packagesToScan' in class 'org.jeecgframework.minidao.factory.MiniDaoBeanFactory'
- No setter found for property 'packagesToScan' in class 'org.jeecgframework.minidao.factory.MiniDaoBeanFactory' [config set: jeecg-3.6.5/web-
context]
请问怎么解决? 解决了,原来在spring-minidao.xml中<bean id="miniDaoHandler"
class="org.jeecgframework.minidao.factory.MiniDaoBeanScannerConfigurer">
<!-- 是使用什么字母做关键字Map的关键字 默认值origin 即和sql保持一致,lower小写(推荐),upper 大写 -->
<property name="keyType" value="lower"></property>
<!-- 格式化sql -->
<property name="formatSql" value="false"></property>
<!-- 输出sql -->
<property name="showSql" value="false"></property>
<!-- 数据库类型 -->
<property name="dbType" value="mysql"></property>
<!-- dao地址,配置符合spring方式 -->
<property name="basePackage" value="org.jeecgframework.web,com.jeecg,com.test.*.dao"></property>
<!-- 使用的注解,默认是Minidao,推荐 Repository -->
<property name="annotation" value="org.springframework.stereotype.Repository"></property>
</bean>
Jeecg开源社区 / jeecg的文档应该及时更新。
页:
[1]