• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Error when merging manyToMany relation in JPA

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JPA project which searches tweets by keword and should persist the key - tweet pairs in the database. The project has the following entities :



**Tweet** entity

Now I have a class for persisting a Keyword,



As you can see in the Keyword Entity, it has a joinTable and therefore a field that can have a set of tweets.

So whenever I get a key and a set of tweets, first I make a user entity, a set of hashtags and urls out of that tweet. Then I have a new tweet entity object.
In the next step I add this tweet(these tweets) to the keyword entity object.
Now I persist this keyword.

Problem: When I want to search for a keyword for the next time, the keyword exists and I should merge, but I get the following error :





Thank you so much in advance. I'm waiting here.





 
reply
    Bookmark Topic Watch Topic
  • New Topic