Hello everyone, got one (hah!) little problem of my own with Spring Data Rest... I've got a List<Child> children in my Father object, with @OneToMany(mappedBy="father"). Together with the Repositories, this lead to the fact that I can PUT a http://localhost:8080/children/1 text/uri-list to http://localhost:8080/fathers/1/children - and get a 204. But nothing changes, since the collection will be set correctly (by RepositoryPropertyReferenceController.createPropertyReference), but that doesn't change the Child.father reference. So, is there a way to automatically update it when a child is added to the list in Spring Data Rest? Or is there a way to make the thing fail at least, because atm it's failing but claiming to succeed, which is imho the worst thing possible...
Of course, the basic problem is JPA based, since already there adding something to the list and then saving the father does not update the Child.father reference. But with Spring Data Rest, it looks like it works - but the result is wrong
sante85 opened DATAREST-1310 and commented
Hello everyone, got one (hah!) little problem of my own with Spring Data Rest... I've got a List<Child> children in my Father object, with
@OneToMany
(mappedBy="father"). Together with the Repositories, this lead to the fact that I can PUT a http://localhost:8080/children/1 text/uri-list to http://localhost:8080/fathers/1/children - and get a 204. But nothing changes, since the collection will be set correctly (by RepositoryPropertyReferenceController.createPropertyReference), but that doesn't change the Child.father reference. So, is there a way to automatically update it when a child is added to the list in Spring Data Rest? Or is there a way to make the thing fail at least, because atm it's failing but claiming to succeed, which is imho the worst thing possible...Of course, the basic problem is JPA based, since already there adding something to the list and then saving the father does not update the Child.father reference. But with Spring Data Rest, it looks like it works - but the result is wrong
Affects: 3.1.3 (Lovelace SR3)
Attachments:
Issue Links:
("is duplicated by")
3 votes, 1 watchers
The text was updated successfully, but these errors were encountered: