无法执行 JDBC 批量更新
我对实体类有疑问。当我使用 hibernate.hbm2ddl.auto = create 运行我的应用程序时,它会创建所有其他实体表,但不会创建此实体表。这是为什么?当我自己创建表格并尝试在其中插入一些内容时,我收到此错误: http://pastebin .com/m4gjxqNC
这是我的实体类: 用户实体: http://pastebin.com/YXvzFSgt 评论实体: http://pastebin.com/RpZEUPxN
这是 UserDAO 类 http://pastebin.com/LrTCg0GC
I have a problem with a entity class. When I run my app with hibernate.hbm2ddl.auto = create, then it create all the other entity tables but not this on. Why is that? And when I create the table by myself and after that try to insert something into it, then I get this error: http://pastebin.com/m4gjxqNC
Here's my entity class:
User entity:
http://pastebin.com/YXvzFSgt
Comment entity:
http://pastebin.com/RpZEUPxN
And here's the UserDAO class
http://pastebin.com/LrTCg0GC
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎正在使用 PostgreSQL。根据此文档,“用户”是 PostgreSQL保留字。尝试为您的 User 实体添加 @Table("user_tb") 注释,以强制使用新的表名称。
You seems to be using PostgreSQL. As per this document, 'User' is a PostgreSQL reserved word. Try adding a @Table("user_tb") annotation for your User entity, to force a new table name.