• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

OneToMany/ManyToOne mapping, children are not deleted with update (PUT)

 
Ranch Hand
Posts: 31
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm still struggling and fighting to get a OneToMany/ManyToOne working. The examples I have found till now, have the same issue and I have also found here the question but not the solution or I do not understand it.

I have the two Entities:
parent Employee @OneToMany:The Child side: @Many-To-One:

The update employee service implementation:

And this is what I inject with Postman the create (POST):

I have two "employeeModelLogging" records at the time of creation of an Employee.

Now I do an update with postman:

When I execute the update, than there are still two records in the database. (It is not a problem to update fields from the employee or department, etc. This is working fine)

I have tried this, by removing the second recordThe second loggingModel is removed from the JPA I think, but not in the database. But I this, if this should work, than at least I know which way I have to go...

I hope that someone has an idea and can tell me what I'm doing wrong...
 
You got style baby! More than this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic