I used old JPA so that I can use code as below:
JpaProperties jpaProerties;
EntityManagerFactoryBuilder(jpaVendorAdapter, jpaProperties, persistenceUnitManager)
Now it is deprecated so I want to change it to
JpaProperties jpaProerties;
EntityManagerFactoryBuilder(JpaVendorAdapter, jpaProerties.getProperties(), PersistenceUnitManager)
But I got error as below:
The method EntityManagerFactoryBuilder(JpaVendorAdapter, Map<String,String>, PersistenceUnitManager) is undefined
I don't know why Map<String, String>
can't used for Map<String, ?>
later is wild and all objects should be used, May I make sense? How can I do to slove it?
Here is my code :
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
@Bean
@ConfigurationProperties("app.master.jpa")
public JpaProperties masterJpaProperties() {
return new JpaProperties();
}
@Bean
public LocalContainerEntityManagerFactoryBean masterEntityManager() {
JpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
EntityManagerFactoryBuilder builder = EntityManagerFactoryBuilder(jpaVendorAdapter, masterJpaProperties.getProperties(), this.persistenceUnitManager);
return builder
.dataSource(masterDataSource())
.packages(Customer.class)
.persistenceUnit("masters")
.build();
}
The error is
Multiple markers at this line
- The method EntityManagerFactoryBuilder(JpaVendorAdapter, Map<String,String>, PersistenceUnitManager) is undefined for the
type MasterConfiguration
- The method EntityManagerFactoryBuilder(JpaVendorAdapter, Map<String,capture#1-of ?>, PersistenceUnitManager) is undefined
for the type MasterConfiguration