{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3654","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3654/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3654/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3654/events","html_url":"https://github.com/spring-projects/spring-boot/issues/3654","id":98821272,"number":3654,"title":"EntityManagerFactoryBuilder does not apply spring.jpa.hibernate customizations automatically","user":{"login":"eepstein","id":3422531,"avatar_url":"https://avatars.githubusercontent.com/u/3422531?v=3","gravatar_id":"","url":"https://api.github.com/users/eepstein","html_url":"https://github.com/eepstein","followers_url":"https://api.github.com/users/eepstein/followers","following_url":"https://api.github.com/users/eepstein/following{/other_user}","gists_url":"https://api.github.com/users/eepstein/gists{/gist_id}","starred_url":"https://api.github.com/users/eepstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eepstein/subscriptions","organizations_url":"https://api.github.com/users/eepstein/orgs","repos_url":"https://api.github.com/users/eepstein/repos","events_url":"https://api.github.com/users/eepstein/events{/privacy}","received_events_url":"https://api.github.com/users/eepstein/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/in%20progress","name":"in progress","color":"eac04b"}],"state":"open","locked":false,"assignee":{"login":"wilkinsona","id":914682,"avatar_url":"https://avatars.githubusercontent.com/u/914682?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false},"milestone":null,"comments":14,"created_at":"2015-08-03T19:29:28Z","updated_at":"2015-08-31T18:29:55Z","closed_at":null,"body":"When using a single data source and entity manager in a Spring Boot JPA project, the hibernate settings are picked up from the application properties (e.g., the application.yml file) and applied as expected.\r\n\r\nIn the case of multiple data source and entity managers, the naming_strategy setting is not applied and thus we get the default naming strategy.  A minor bug with a likely quick fix I imagine.\r\n\r\nI've put together a sample project showing the issue:\r\n\r\nhttps://github.com/eepstein/multids-demo\r\n\r\n(which was forked from https://github.com/gratiartis/multids-demo)\r\n\r\nThe relevant lines are in the FooConfig and BarConfig classes.  For example, from com.sctrcd.multidsdemo.integration.config.foo.FooConfig:\r\n\r\n                        // This is to work-around a bug in Spring boot, which is not setting the naming strategy when there\r\n                        // are multiple data sources and entity managers.\r\n                .properties(Collections.singletonMap(\"hibernate.ejb.naming_strategy\",\r\n                        jpaProperties.getHibernate().getNamingStrategy()))\r\n\r\nIf you comment out that line you'll see an assertion in the test will fail, even though the naming strategy is being correctly set in the application-test.yml file in the test resources folder.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/136455005","html_url":"https://github.com/spring-projects/spring-boot/issues/3654#issuecomment-136455005","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3654","id":136455005,"user":{"login":"snicoll","id":490484,"avatar_url":"https://avatars.githubusercontent.com/u/490484?v=3","gravatar_id":"","url":"https://api.github.com/users/snicoll","html_url":"https://github.com/snicoll","followers_url":"https://api.github.com/users/snicoll/followers","following_url":"https://api.github.com/users/snicoll/following{/other_user}","gists_url":"https://api.github.com/users/snicoll/gists{/gist_id}","starred_url":"https://api.github.com/users/snicoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snicoll/subscriptions","organizations_url":"https://api.github.com/users/snicoll/orgs","repos_url":"https://api.github.com/users/snicoll/repos","events_url":"https://api.github.com/users/snicoll/events{/privacy}","received_events_url":"https://api.github.com/users/snicoll/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T18:29:54Z","updated_at":"2015-08-31T18:29:54Z","body":"I think you misunderstood my point. Yes, the standard property does not work (that's why this issue exists). I am proposing a *workaround* for the time being.\r\n\r\n> You can workaround the issue by specifying the following in your configuration\r\n>\r\n> `spring.jpa.properties.hibernate.ejb.naming_strategy=FooBar`"}}