Nałożyłem na klasę adnotację JsonIdentityInfo:
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
@Entity
@Table(name = "`COMPANY`")
public class Company {
...
z serwisu zwracam listę obiektów w postaci json, po stronie klienta wygląda tak:
[{
"id": 948,
"title": "titlee",
"company": {
"id": 926,
"name": "namee",
"password": "passwordd"
},
"category": "Cat",
"createdDate": 1528408274691,
"lastEditDate": 1528408274691,
"updateVersion": null
}, {
"id": 949,
"title": "titlee",
"company": 926,
"category": "Cat",
"createdDate": 1528408284037,
"lastEditDate": 1528408284037,
"updateVersion": null
}, {
"id": 950,
"title": "titlee",
"company": 926,
"category": "Cat",
"createdDate": 1528408284555,
"lastEditDate": 1528408284555,
"updateVersion": null
}, {
"id": 951,
"title": "titlee",
"company": 926,
"category": "Cat",
"createdDate": 1528408285035,
"lastEditDate": 1528408285035,
"updateVersion": null
}]
Dlaczego w pierwszym obiekcie dostaję cały obiekt COMPANY zamiast tylko elementu property ustawionego w adnotacji JsonIdentityInfo- w tym przypadku id?