File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/java/ca/uhn/fhir/jpa/starter/util Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,19 @@ public static Properties getHibernateProperties(
40
40
properties .put (strippedKey , entry .getValue ().toString ());
41
41
}
42
42
43
+ // also check for JPA properties set as environment variables, this is slightly hacky and doesn't cover all
44
+ // the naming conventions Springboot allows
45
+ // but there doesn't seem to be a better/deterministic way to get these properties when they are set as ENV
46
+ // variables and this at least provides
47
+ // a way to set them (in a docker container, for instance)
48
+ Map <String , Object > jpaPropsEnv = getPropertiesStartingWith (environment , "SPRING_JPA_PROPERTIES" );
49
+ for (Map .Entry <String , Object > entry : jpaPropsEnv .entrySet ()) {
50
+ String strippedKey = entry .getKey ().replace ("SPRING_JPA_PROPERTIES_" , "" );
51
+ strippedKey = strippedKey .replaceAll ("_" , "." );
52
+ strippedKey = strippedKey .toLowerCase ();
53
+ properties .put (strippedKey , entry .getValue ().toString ());
54
+ }
55
+
43
56
// Spring Boot Autoconfiguration defaults
44
57
properties .putIfAbsent (AvailableSettings .SCANNER , "org.hibernate.boot.archive.scan.internal.DisabledScanner" );
45
58
properties .putIfAbsent (
You can’t perform that action at this time.
0 commit comments