当前位置:   article > 正文

Spring Boot多数据源:getHibernateProperties(hibernateSettings)报错

gethibernateproperties

我使用的是Spring Boot 2.16 而在这个版本中getHibernateProperties已经被弃用了

  • 报错情况:
    在设置多数据源的默认数据源时,我们通常这样写
    package wen.datademo.comm;
    
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.beans.factory.annotation.Qualifier;
    import org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings;
    import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
    import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
    import org.springframework.orm.jpa.JpaTransactionManager;
    import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
    import org.springframework.transaction.PlatformTransactionManager;
    import org.springframework.transaction.annotation.EnableTransactionManagement;
    
    import javax.
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/article/detail/52312
推荐阅读
相关标签
  

闽ICP备14008679号