• 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

JPA: Delete Row on Compound Primary Key that has JoinColumns

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to delete a row. My Entity has a 3 part compound primary key where 2 of them are foreign key JoinColumns. When I call the built in "delete()" on the JpaRepository and pass in the entity it errors on one of the 2 JoinColumns in the Primary Key.

Error:
Failed to convert property value of type 'java.lang.String' to required type 'MyTableEntity' for property 'join_column_property_name'

Can anyone help?
 
Sheriff
Posts: 22147
115
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Can you show us some of your code? We won't need the full entities, but the relevant fields (and possible embedded id classes) need to be shown. Can you also show your JPA query?
 
Saloon Keeper
Posts: 23515
161
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My memory is really fuzzy here, but if I recall, the Spring JpaRepository feature provided a generic finder/CRUD service so that you wouldn't have to code a lot of repetitive stuff.

The downside was that it was somewhat limited in what it could handle. It may be that you have exceeded those limits and are going to have to code your Repository/DAO the hard way.
 
This guy is skipping without a rope. At least, that's what this tiny ad said:
ScroogeXHTML - a fast and small RTF to HTML5 and XHTML converter library
https://coderanch.com/t/742149/ScroogeXHTML-RTF-HTML-XHTML-converter
reply
    Bookmark Topic Watch Topic
  • New Topic