开始UserRepository定义如下
1 2 3 4 5 6 7 8 9 10 |
@Repository public class UserRepository extends SimpleR2dbcRepository<User, Integer> { public UserRepository(RelationalEntityInformation<User, Integer> entity, R2dbcEntityOperations entityOperations, R2dbcConverter converter) { super(entity, entityOperations, converter); } } |
报如下错误:
Parameter 0 of constructor in cn.javacoder.dao.UserRepository
required a bean of type' org.springframework.data.relational.repository.query.RelationalEntityInformation'
that could not be found.
RepositoryComponentProvider.InterfaceTypeFilter#match
要求必须是接口,才会判断是否可以赋值给Repository
改成如下
1 2 3 4 |
@Repository public interface UserRepository extends R2dbcRepository<User, Integer> { } |
Posted in: spring practise
Comments are closed.