Your error clearly pointed that you have not created database table : shopdb.payment .
(您的错误明确指出您尚未创建数据库表: shopdb.payment 。)
And because of that your persistence flow getting break(Error : creating bean with entity manager relate with that).
(由于这个原因,您的持久流将中断(错误:使用实体管理器创建bean与此相关)。)
If you don't want to put any configuration for auto generate table then create manually but if you do that dynamically then,
(如果您不想为自动生成表添加任何配置,则可以手动创建,但如果您动态地进行配置,)
There is several reasons for database table not created at run time:
(在运行时未创建数据库表的原因有很多:)
- AutoConfiguration aren't work properly.
(自动配置无法正常工作。)
Add annotation(Given Or other provided by spring), (添加批注(Given或spring提供的其他),)
@EnableAutoConfiguration
(@EnableAutoConfiguration)
@PropertySource
(@PropertySource)
@EntityScan
(@EntityScan)
- Database configuration and auto creation statement not properly placed in application.configuration / application.yml file.
(数据库配置和自动创建语句未正确放置在application.configuration / application.yml文件中。)
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
(spring.jpa.database-platform = org.hibernate.dialect.MySQL5InnoDBDialect)
spring.jpa.generate-ddl=true
(spring.jpa.generate-ddl = true)
spring.jpa.hibernate.ddl-auto=create
(spring.jpa.hibernate.ddl-auto =创建)
spring.datasource.driverClassName=com.mysql.jdbc.Driver
(spring.datasource.driverClassName = com.mysql.jdbc.Driver)
spring.datasource.url=jdbc:mysql://localhost:3306/shopdb
(spring.datasource.url = jdbc:mysql:// localhost:3306 / shopdb)
spring.datasource.username=database_username
(spring.datasource.username =数据库用户名)
spring.datasource.password=database_password
(spring.datasource.password =数据库密码)
Here some case you need to create default schema of your database.
(在某些情况下,您需要创建数据库的默认架构。)
In some situation case sensitivity create ideal role when you do this kind of activity,
(在某些情况下,当您进行此类活动时,敏感性会发挥理想的作用,)
I highly recommended that define @Table, @Column annotation or Lombok kind of library(If supportable to your version).
(我强烈建议定义@ Table,@ Column批注或Lombok类的库(如果您的版本支持)。)
Check your column name as per your requirement(Not related with error).
(根据您的要求检查列名(与错误无关)。)
Also verify your mapping is exist, place and work properly with private context.
(还要验证您的映射是否存在,并在私有上下文中正确放置和使用。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…