JPA 报错 SQLGrammarException: error performing isolated work

Apparently hibernate looks for sequence tables for generating the id. Setting the following:

@GeneratedValue(strategy = GenerationType.IDENTITY)

on the id, causes it to use the underlying db’s auto increment and not try to generate the id itself, and now it works.


把主键字段上的注解写成如上即可


How to insert new items with Hibernate?

https://stackoverflow.com/questions/22472292/how-to-insert-new-items-with-hibernate


hibernate在数据库生成hibernate_sequence表问题

https://blog.csdn.net/danchaofan0534/article/details/53608832

你可能感兴趣的:(Spirng,Data,JPA)