diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java index a207980387..276f862011 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java @@ -124,7 +124,6 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware { EntityManagerFactoryBuilder builder = new EntityManagerFactoryBuilder( jpaVendorAdapter, this.properties.getProperties(), persistenceUnitManager.getIfAvailable()); - builder.setCallback(getVendorCallback()); for (EntityManagerFactoryBuilderCustomizer customizer : customizers .getIfAvailable(Collections::emptyList)) { customizer.customize(builder); @@ -157,10 +156,6 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware { protected void customizeVendorProperties(Map vendorProperties) { } - protected EntityManagerFactoryBuilder.EntityManagerFactoryBeanCallback getVendorCallback() { - return null; - } - protected String[] getPackagesToScan() { List packages = EntityScanPackages.get(this.beanFactory) .getPackageNames(); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/EntityManagerFactoryBuilder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/EntityManagerFactoryBuilder.java index 562e800186..6c0b1311e9 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/EntityManagerFactoryBuilder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/EntityManagerFactoryBuilder.java @@ -111,6 +111,7 @@ public class EntityManagerFactoryBuilder { * An optional callback for new entity manager factory beans. * @param callback the entity manager factory bean callback */ + @Deprecated public void setCallback(EntityManagerFactoryBeanCallback callback) { this.callback = callback; } @@ -213,6 +214,7 @@ public class EntityManagerFactoryBuilder { return this; } + @SuppressWarnings("deprecation") public LocalContainerEntityManagerFactoryBean build() { LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean(); if (EntityManagerFactoryBuilder.this.persistenceUnitManager != null) { @@ -260,6 +262,7 @@ public class EntityManagerFactoryBuilder { * A callback for new entity manager factory beans created by a Builder. */ @FunctionalInterface + @Deprecated public interface EntityManagerFactoryBeanCallback { void execute(LocalContainerEntityManagerFactoryBean factory);