Commit b3ba8639 authored by Phillip Webb's avatar Phillip Webb

Relax EntityManagerFactoryBuilder Map generic

Relax the generic signature on EntityManagerFactoryBuilder.properties
so that any object type can be added.

Fixed gh-1376
parent ebd0d265
......@@ -137,7 +137,7 @@ public class EntityManagerFactoryBuilder {
* @param properties the properties to use
* @return the builder for fluent usage
*/
public Builder properties(Map<String, String> properties) {
public Builder properties(Map<String, ?> properties) {
this.properties.putAll(properties);
return this;
}
......
......@@ -16,6 +16,7 @@
package org.springframework.boot.autoconfigure.orm.jpa;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.persistence.EntityManager;
......@@ -67,8 +68,10 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration {
}
@Override
protected Map<String, String> getVendorProperties() {
return this.properties.getHibernateProperties(this.dataSource);
protected Map<String, Object> getVendorProperties() {
Map<String, Object> vendorProperties = new LinkedHashMap<String, Object>();
vendorProperties.putAll(this.properties.getHibernateProperties(this.dataSource));
return vendorProperties;
}
static class HibernateEntityManagerCondition extends SpringBootCondition {
......
......@@ -102,14 +102,14 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware {
@Primary
@ConditionalOnMissingBean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
EntityManagerFactoryBuilder factory) {
return factory.dataSource(this.dataSource).packages(getPackagesToScan())
EntityManagerFactoryBuilder factoryBuilder) {
return factoryBuilder.dataSource(this.dataSource).packages(getPackagesToScan())
.properties(getVendorProperties()).build();
}
protected abstract AbstractJpaVendorAdapter createJpaVendorAdapter();
protected abstract Map<String, String> getVendorProperties();
protected abstract Map<String, Object> getVendorProperties();
protected EntityManagerFactoryBuilder.EntityManagerFactoryBeanCallback getVendorCallback() {
return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment