Java 是否可以使用SpringData创建通用存储库?
我想知道怎样才能创建这样一种通用存储库Java 是否可以使用SpringData创建通用存储库?,java,spring,orm,spring-data-jpa,crud,Java,Spring,Orm,Spring Data Jpa,Crud,我想知道怎样才能创建这样一种通用存储库 @Repository public interface GenericApiDao<T> extends CrudRepository<T, Integer> { } 为什么我们没有权利只在执行时对SpringData说类型 谢谢你的帮助^^ JOSSpring数据需要类型信息来实现存储库接口并创建(实例化和初始化)相应的bean。Spring数据需要类型信息来实现存储库接口并创建(实例化和初始化)相应的bean。 &
@Repository
public interface GenericApiDao<T> extends CrudRepository<T, Integer> {
}
为什么我们没有权利只在执行时对SpringData说类型
谢谢你的帮助^^
JOSSpring数据需要类型信息来实现存储库接口并创建(实例化和初始化)相应的bean。Spring数据需要类型信息来实现存储库接口并创建(实例化和初始化)相应的bean。
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'genericApiDao': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Not a managed type: class java.lang.Object