在openjpa上配置以启动Spring Boot [英] configure openjpa on to spring boot

查看:116
本文介绍了在openjpa上配置以启动Spring Boot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Spring启动时将Hibernate的默认JPA实现更改为OpenJPA.香港专业教育学院搜索谷歌,但没有太多关于如何配置openJPA到Spring启动.任何意见将是有益的.谢谢

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

推荐答案

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

这篇关于在openjpa上配置以启动Spring Boot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆