auto inkrement for id

hi ive added a new table and im not sure if im missing an error in my application or whether the problem lies with liquibase.


My hibernate entity looks like this:

public class GlobalParameter {

    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    private String parameterKey;
    private String parameterValue;   

Whenever i try to save objects with id value null into the db it throws an error: “java.sql.SQLException: Field ‘id’ doesn’t have a default value”

Is it possible, that this is because i havent told liquibase that my pkey id has to be auto incremented? If so how can i do this? i do not find the solution in the examples.


sorry ive found the autoincrement=“true” here in the forum.

Now i need to know how i can modify the column that ive created and add the autoincrement=“true” constraint?

AddAutoIncrement should let you modify the existing column