configure openjpa on to spring boot

喜欢而已 提交于 2020-01-23 13:28:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!