Java Community | Help. Code. Learn.JC|HCL
Java Community | Help. Code. Learn.โ€ข2y agoโ€ข
13 replies
Ed

Springboot GenerationType.UUID not working

@Table(name = "Product")
public class Product {

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

On create drop the sql field becomes:
id uuid not null primary key,

upon inserting a row without specifying my Id field i get the error:
[23502] ERROR: null value in column "id" of relation "product" violates not-null constraint
Was this page helpful?