Several similar questions might have been asked before but I think my situation a bit differ from them. I have one base entity and two other entities that extend from the first one. First entity is not mapped to any table and annotated with @MappedSuperClass. What I try is to create one base repository Interface that extends jPA CrudRepository and one custom repository that will be used all other repository interfaces.
//base Interface
@NoRepositoryBean
public interface RumlorBaseUserRepository<T extends RumlorBaseUser>
extends CrudRepository<T,Integer>,
RumlorBaseUserCustomRepository<T> {
custom repository interface
public interface RumlorBaseUserCustomRepository<T extends RumlorBaseUser> {
and custom repository interface implementation class with naming convention taken into account.
public class RumlorBaseUserCustomRepositoryImpl<T extends RumlorBaseUser>
implements RumlorBaseUserCustomRepository<T> {
And finally my child interface that will extend base Interface fragment and get implemented by spring data.
public interface RumlorUserRepository
extends RumlorBaseUserRepository<RumlorUser>
when I run the code I get the following stacktrace.
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rumlorUserRepository' defined in com.rumlor.keycloakdemo.root.repo.RumlorUserRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract com.rumlor.keycloakdemo.root.model.RumlorBaseUser com.rumlor.keycloakdemo.root.repo.RumlorBaseUserCustomRepository.saveWithFunctionality(com.rumlor.keycloakdemo.root.model.RumlorBaseUser,java.lang.Integer)! Reason: Failed to create query for method public abstract com.rumlor.keycloakdemo.root.model.RumlorBaseUser com.rumlor.keycloakdemo.root.repo.RumlorBaseUserCustomRepository.saveWithFunctionality(com.rumlor.keycloakdemo.root.model.RumlorBaseUser,java.lang.Integer)! No property 'saveWithFunctionality' found for type 'RumlorUser'!; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract com.rumlor.keycloakdemo.root.model.RumlorBaseUser com.rumlor.keycloakdemo.root.repo.RumlorBaseUserCustomRepository.saveWithFunctionality(com.rumlor.keycloakdemo.root.model.RumlorBaseUser,java.lang.Integer)! No property 'saveWithFunctionality' found for type 'RumlorUser'!
I read the spring jpa specification about custom repositories for multiple times. But I can't seem to find where I miss the point.