• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I can't figure out how to do a post request for this. Spring Data JPA- Foreign Keys- Composite Keys

 
Ranch Hand
Posts: 462
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a Student class



A StudentIdentity class.  



And the post method in the controller class.  



I've tried it several different ways in Postman and I get a 400 Bad Request error.  


Does anyone have an idea how you would do this given the class has foreign and composite keys?  
 
Bartender
Posts: 2421
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can first try to remove the school attribute in your studentIdentity id.
Your student identity can include some unique attributes related to the students, such as id number.
But the school is a relationship to the student.

 
reply
    Bookmark Topic Watch Topic
  • New Topic