I'm using Spring
JdbcBatchItemWriter
to flush lots of data to a postgres DB.
INSERT INTO customer (id, name, zip) VALUES (?,?,?)
I only set name + zip as I want the id to be auto generated. But how can I let the db autogenerate the id value? If I execute the statement above, the DB complains as the id is not set.
@Entity
class Customer {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
long id;
}