首页 > 代码库 > Hibernate 自动更新表出错 More than one table found in namespace
Hibernate 自动更新表出错 More than one table found in namespace
报错:Caused by: org.hibernate.tool.schema.extract.spi.SchemaExtractionException: More than one table found in namespace (, ) : data_source
可能原因:在其他catalog schmea 下存在同名表或表名符合格式data_source(如data1source)。
若是在其他catalog schmea 下存在同名表,可配置默认catalog 和schema。
hibernate 中配置参数default_catalog、default_schema,根据数据库是否支持catalog、schema 进行配置。
spring data jpa 中配置方式是在配置文件(application.properties)中配置参数schema,如
spring.jpa.properties.hibernate.default_catalog=yourCatalog
spring.jpa.properties.hibernate.default_schema=yourSchema
若表名符合格式data_source,那就需要自己建表然后取消自动更新ddl。即可能需要寻求其他方式解决。
Hibernate 自动更新表出错 More than one table found in namespace
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。