user2997204
user2997204

Reputation: 1384

External repository and repository implementation

The repository that is being used in the Spring Boot application (this is located in the main module):

@Repository
public interface PersonRepository extends MongoRepository<Person, String>, AzureRepository<Person, String> {

}

The repository and implementation of the repository (these are located in a different maven module):

public interface AzureRepository<T, ID> {

    boolean customUpdate(T entity);

}

public class AzureRepositoryImpl<T, ID> implements AzureRepository<T, ID> {
  ...
}

This configuration produces the following error:

Caused by: org.springframework.data.mapping.PropertyReferenceException: No property customUpdate found for type Person!

The custom repository and its implementation works fine when everything is in the same maven module. But when the custom repository and its implementation are placed in the utility maven module then the error from above gets thrown.

Upvotes: 2

Views: 242

Answers (1)

user2997204
user2997204

Reputation: 1384

Instead of using @EnableJpaRepositories I should've used @EnableMongoRepositories to specify the base package of the external repositories.

Upvotes: 1

Related Questions