问题
Im trying to change the default JPA implementation of Hibernate to OpenJPA on Spring boot. Ive searched on google but there is not much on how to configure openJPA to Spring boot. Any advice would be helpful. Thanks
回答1:
@Configuration
public class OpenJPAConfig extends JpaBaseConfiguration {
protected OpenJPAConfig(DataSource dataSource, JpaProperties properties,
ObjectProvider<JtaTransactionManager> jtaTransactionManager,
ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
super(dataSource, properties, jtaTransactionManager, transactionManagerCustomizers);
}
@Override
protected AbstractJpaVendorAdapter createJpaVendorAdapter() {
return new OpenJpaVendorAdapter();
}
@Override
protected Map<String, Object> getVendorProperties() {
return new HashMap<>(0);
}
}
来源:https://stackoverflow.com/questions/47928001/configure-openjpa-on-to-spring-boot