spring-projects / spring-projects/spring-data-rest

One to Many not save link array [DATAREST-1297]

Open
#1,657 2 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 31, 2020.

type: bug
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

sante85 opened DATAREST-1297 and commented

Steps to reproduce:

  1. Create entity with the following relation:

@OneToMany(mappedBy = "swimmingpoolImplant")
private Set<ConduitSwimmingpool> conduits = new HashSet<>();

  1. Create PagingAndSortingRepository for the entity

  2. Send PUT on relation request to update the entity (add relation item with 'Id' : 194):{

 "http://192.168.1.220:82/HF/conduits/194"

}

  1. Read entity with GET (to see what is the current state of the entity)
    expected: {
    "id": 242,
    "_embedded": {
    "conduitSwimmingpools": [

"http://192.168.1.220:82/HF/conduits/194"

]
},
"_links": {
"self": {
"href": "http://192.168.1.220:82/HF/swimmingpoolImplants/242/conduits"
}
}

actual:
"id": 242,
"_embedded": {
"conduitSwimmingpools": []
},
"_links": {
"self": {
"href": "http://192.168.1.220:82/HF/swimmingpoolImplants/242/conduits"
}
}

 


Affects: 3.0.11 (Kay SR11)

Attachments:

2 votes, 4 watchers

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.