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_sourcespring

可能缘由:在其余catalog schmea 下存在同名表或表名符合格式data_source(如data1source)。数据库

如果在其余catalog schmea 下存在同名表,可配置默认catalog 和schema。app

hibernate 中配置参数default_catalog、default_schema,根据数据库是否支持catalog、schema 进行配置。spa

spring data jpa 中配置方式是在配置文件(application.properties)中配置参数schema,如hibernate

spring.jpa.properties.hibernate.default_catalog=yourCatalogio

spring.jpa.properties.hibernate.default_schema=yourSchematable

若表名符合格式data_source,那就须要本身建表而后取消自动更新ddl。便可能须要寻求其余方式解决。sed

相关文章
相关标签/搜索