i use querydsl
that's why i don't need method like findByName()
and all my repository interface are empty.
So i try to make genric code to avoid repetitive interface with empty methods because i have many classes in my entities mapped by hibernate.
public interface GenericResposotory<T>
extends JpaRepository<T, Integer>, QueryDslPredicateExecutor<T> {
}
When I run my server I get this error :
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
also there is not a way to make a generic repository like i try to do ?
Spring data tries to create beans for all interfaces you create that extend JpaRepository. If you want to have a kind of base repository that will not be used mark your interface with @NoRepositoryBean
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With