I am working on a Spring Boot project where the application can use either MongoDB or PostgreSQL depending on a property value. I have two repository implementations: MongoDB repository: @Repository @ConditionalOnProperty(name = “app.storage”, havingValue = “mongo”) public class MongoTreeRepository implements TreeRepository { } PostgreSQL repository: @Repository @ConditionalOnProperty(name = “app.storage”, havingValue = “postgres”) public class PostgresTreeRepository implements TreeRepository { } In application.properties I use either: app.storage=mongo or: app.storage=postgres My service rece