You*_*sef 8 spring hibernate querydsl spring-data
我使用querydsl这就是为什么我不需要方法findByName(),我的所有存储库接口都是空的.
所以我尝试制作genric代码以避免重复的空方法接口,因为我在hibernate映射的实体中有很多类.
public interface GenericResposotory<T>
extends JpaRepository<T, Integer>, QueryDslPredicateExecutor<T> {
}
Run Code Online (Sandbox Code Playgroud)
当我运行我的服务器时,我收到此错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'genericResposotory':
Invocation of init method failed; nested exception is
java.lang.IllegalArgumentException: Not an managed type: class java.lang.Object
Run Code Online (Sandbox Code Playgroud)
还有没有办法像我尝试做一个通用的存储库?
| 归档时间: |
|
| 查看次数: |
732 次 |
| 最近记录: |