I am working on a Spring Boot Project. I have the following entity :
@Entity
@Table(name = "authors")
public class Author {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "author_seq")
@SequenceGenerator(name = "author_seq",
sequenceName = "authors_authorid_seq", schema = "public")
private int authorid;
private String name;
private String surname;
public Author() {
}
public int getAuthorid() {
return authorid;
}
public void setAuthorid(int authorid) {
this.authorid = authorid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
}
I have the following sequences in database :
authors_authorid_seq
bookborrow_id_seq
books_bookid_seq
users_userid_seq
am getting the following error :
org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing sequence [public.authors_authorid_seq]
Can you please help me about what I am doing wrong? My Hibernate version is 5.4.25. Thanks