Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One to Many put not change a collection [DATAREST-1311] #1671

Closed
spring-projects-issues opened this issue Nov 29, 2018 · 0 comments
Closed

One to Many put not change a collection [DATAREST-1311] #1671

spring-projects-issues opened this issue Nov 29, 2018 · 0 comments
Assignees
Labels
in: repository status: duplicate type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Nov 29, 2018

sante85 opened DATAREST-1311 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)

Issue Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: repository status: duplicate type: bug
Projects
None yet
Development

No branches or pull requests

2 participants