Spring Boot应用程序不将数据写入MySQL
我创建一个简单的春季启动应用程序。运行该应用程序在浏览器中显示一个JSON员工表,但是当我使用命令行或MySQL工作台检查MySQL数据库时,会生成表员工表,但没有内容。
从Intellij运行该应用不会给我任何错误:
在github上查看我的代码: demo
I create a simple Spring Boot application. Running the app shows a JSON employee table in the browser, but when I check MySQL database with the command-line or MySQL Work-bench, a table employee table is generated, but no content.
Running the app from IntelliJ doesn't give me any error:
Take a look at my code on github:
demo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

您只有静态数据,您不使用JPA方法来保存,这就是为什么它不保存数据库表的原因。
You have only static data you are not using Jpa method for save that's why it's not saving in database table.