What I want to do is add (POST) resource with automaticly generated id. I added annotations and my model looks like this
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String brand;
Question is why when I POST some value without id for example:
{
"brand": "sony"
}
I GET automaticly id = 0:
{
"id": 0,
"brand": "sony"
}
And if I post more resources without calling id they all have id = 0 (so it's not unique).
What I do wrong?