From 6fa37a9439a11f9eca30e3d4fa7f59843b56b50a Mon Sep 17 00:00:00 2001 From: Dhiman Seal Date: Tue, 16 Jan 2024 00:02:01 +0530 Subject: [PATCH] Update README.md --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 413aa9b..47f60c1 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,10 @@ intended to be used for generating code for configuring data sources during the exactEntityPackages = { "com.sample.project.sample_service.entities.mysql" }, - primaryDataSourceConfig = @DataSourceConfig(dataSourceName = "master"), + primaryDataSourceConfig = @DataSourceConfig( + dataSourceName = "master", + overridingPropertiesPath = "spring.datasource.master.extra-properties" + ), secondaryDataSourceConfigs = { @DataSourceConfig(dataSourceName = "replica-2"), @DataSourceConfig(dataSourceName = "read-replica") @@ -218,12 +221,16 @@ intended to be used for generating code for configuring data sources during the username: ${DB_USERNAME} password: ${DB_PASSWORD} type: com.zaxxer.hikari.HikariDataSource - read-replica: # This will become the kebab case of the data source name + extra-properties: + hibernate.generate_statistics: true # Generate hibernate statistics only for master data source. + read-replica: # This will become the kebab case of the data source name driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://${READ_REPLICA_DB_IP}:${DB_PORT}/${READ_REPLICA_DB_NAME} username: ${DB_USERNAME} password: ${DB_PASSWORD} type: com.zaxxer.hikari.HikariDataSource + jpa.properties: # Global JPA Properties + hibernate.generate_statistics: false ``` 8. Please always go through the generated code to learn more about what configs to give and what