0
votes

Background

I'm trying to create a custom implementation for my spring boot data jpa application.

I've created a UserRepsitoryCustom interface with "List<User> getUsers(String type)" method.

I've created a UserRepository interface with extends CrudRepository<User, Long>, QueryDslPredicateExecutor<User>, UserRepositoryCustom.

I've created a UserRepositoryImpl class which extends UserRepositoryCustom interface and implements the "getUsers(String type)" method.

Problem

My expectation was that spring boot-data-jpa will create me a repository bean that combines all the goodies from CrudRepository & QueryDslPredicateExecutor and additional will know to use my custom implementation repository.

Currently, all I'm getting is

PropertyReferenceException: No property getUsers found...

I haven't annotated the UserRepositoryImpl with any @Component or @Repository. and I haven't changed any default configuration.

What am I doing wrong?

Thanks!

1
Try it with @Transactional at your ´UserRepository interface`. But your code will help a lot to help you - Patrick
according to your question you are doing everything correct. But obviously that cannot be the case as you are having the error. follow these steps again docs.spring.io/spring-data/jpa/docs/current/reference/html/…. if you still face the issue. post the source codes. Also make sure you have not changed the configuration for repository impl postfix. - Faraj Farook

1 Answers

0
votes

I've found my problem!!! The UserRepositoryImpl was in the wrong package name... I've moved it to the right package name and it's done!