【发布时间】:2018-01-30 17:13:10
【问题描述】:
我有一个可以访问多个数据源的 Spring Boot 应用程序,因此我以编程方式为每个数据库创建了数据源。
我的数据库在 SQL Server 上
我还为每个数据源注入了 LocationContainerEntityManagerFactoryBean。
在 EntityManager 中,我包含了以下 JPA 属性
hibernate.hb2ddl.auto=validate
hibernate.default_schema=xyz
虽然我的实体存在于 db 和模式 xyz 中,但 Hibernate 会抛出未找到表 abc 的模式管理异常。
如果我删除 hibernate.hb2ddl.auto=validate 属性,hibernate 能够识别表。
之前有人遇到过这个问题吗? 感谢任何帮助
【问题讨论】:
标签: hibernate jpa spring-boot