Spring Data Jpa出现“Table ‘XXX.hibernate_sequence‘ doesn‘t exist”

Problem description: When using Spring Data Jpa as the database persistence layer, the following error is reported when the project starts:

“Table 'XXX.hibernate_sequence' doesn't exist”

Solution:

This error is caused by the self-growth strategy of the entity class's primary key. The primary key generation strategy needs to be modified as follows:

/**
 * 主键id
 */
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Id
@Column(name = "id")
private int id;

 

Guess you like

Origin blog.csdn.net/y_bccl27/article/details/114436265