I am making an application with hibernate, but it is generating and error:
"ids for this class must be manually assigned before calling save ()"
The class that is saying it is wrong is like this.
@Entity
@Table(name = "USER")
public class TodoModel {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id_todo;
private String nomeTodo;
private String usuario;
...Getters/Setters/HashCode/Equals..
And the table was created this way
CREATE TABLE USER (
id_todo INT(5) NOT NULL AUTO_INCREMENT,
nomeTodo VARCHAR(15),
usuario VARCHAR(15),
PRIMARY KEY (id_todo)
);
Even changing the GenerationType method to IDENTITY did not work. The solutions I see around always suggest putting IDENTITY or AUTO that would work, but here it did not work.
What can it be?