close

[Solved] Table ‘DBNAME.hibernate_sequence’ doesn’t exist

Hello Guys, How are you all? Hope You all Are Fine. Today I am facing the following error Table ‘DBNAME.hibernate_sequence’ doesn’t exist in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Table ‘DBNAME.hibernate_sequence’ doesn’t exist Error Occurs?

Today I am facing the following error Table ‘DBNAME.hibernate_sequence’ doesn’t exist in Java.

How To Solve Table ‘DBNAME.hibernate_sequence’ doesn’t exist Error ?

  1. How To Solve Table 'DBNAME.hibernate_sequence' doesn't exist Error ?

    To Solve Table 'DBNAME.hibernate_sequence' doesn't exist Error With the generation GenerationType.AUTO hibernate will look for the default hibernate_sequence table , so change generation to IDENTITY as below :

  2. Table 'DBNAME.hibernate_sequence' doesn't exist

    To Solve Table 'DBNAME.hibernate_sequence' doesn't exist Error With the generation GenerationType.AUTO hibernate will look for the default hibernate_sequence table , so change generation to IDENTITY as below :

Solution 1

With the generation GenerationType.AUTO hibernate will look for the default hibernate_sequence table , so change generation to IDENTITY as below :

 @Id
 @GeneratedValue(strategy = GenerationType.IDENTITY)
 private Long id;

Solution 2

Add the following config in your application.yml:

spring: jpa: hibernate: use-new-id-generator-mappings: false

Or this if you use application.properties

spring.jpa.hibernate.use-new-id-generator-mappings= false

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read