spring-projects/spring-data-examples

The examples dont provide application.property settings needed for connecting to multiple databases using JPA

dbnex14 opened this issue · 1 comments

I see no information about setting properties such as url, username, password, hibernate dialect. Is it missing?

With multiple data sources you can't simply rely on Spring Boot to pick up your configuration from the application.properties instead you'll have to do that on your own.

In the examples this setup is done in CustomerConfig and OrderConfig
This is also described in the readme of the example.

Of course ,you can store information that you want to be easily changed in the application.properties and then inject it in your configuration class, but that is just one of many ways you can handle it and not special for Spring Data. Therefore that isn't included in the example. See for example https://stackoverflow.com/questions/317687/how-can-i-inject-a-property-value-into-a-spring-bean-which-was-configured-using for more ideas.