如何将Map <string,string =“”>转换为Map <string,?=“”>

时间:2016-01-22 04:06:04

标签: java dictionary properties spring-boot entitymanager

我使用旧的JPA,以便我可以使用如下代码:

JpaProperties jpaProerties;
EntityManagerFactoryBuilder(jpaVendorAdapter, jpaProperties, persistenceUnitManager)

现在它已被弃用,因此我想将其更改为

JpaProperties jpaProerties;
EntityManagerFactoryBuilder(JpaVendorAdapter, jpaProerties.getProperties(), PersistenceUnitManager)

但我收到的错误如下:

The method EntityManagerFactoryBuilder(JpaVendorAdapter, Map<String,String>, PersistenceUnitManager) is undefined

我不知道为什么Map<String, String>以后Map<String, ?>不能用于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(); } 是狂野的,应该使用所有对象,我可以理解吗?我该怎么做才能解决它? 这是我的代码:

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

错误是

public int[] frontPiece(int[] nums) {
int[] newi;
if (nums.length >= 2)
{
for(int i = 0; i < 2; i++)
{
newi = new int[2];
newi[i] = nums[i];
}
}
else
{
for( int i = 0; i < nums.length; i++)
{
newi = new int[nums.length];
newi[i] = nums[i];

}
}
return newi;
}

0 个答案:

没有答案