将 openjpa 配置为 spring 启动

configure openjpa on to spring boot

我正在尝试在 Spring 引导时将 Hibernate 的默认 JPA 实现更改为 OpenJPA。我在 google 上搜索过,但关于如何将 openJPA 配置为 Spring 启动的内容并不多。任何意见将是有益的。谢谢

@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);
    }
}