DISQUS

Adrian Smith's Blog: Problem with Hibernate many-to-many association

  • Canda · 2 years ago
    Many many thanks for this... I was stuck on this for ages too!

    Great job
  • Sat Freak · 2 years ago
    Hi there,

    same here, while in a different context:

    Using JPA with Hibernate populating an many-to-many Realtionship, where all Entities on both ends are already persistent. The JoinTable was empty, although no exception was thrown.

    Calling flush() befor calling a merge() did the job!

    Many thanks for this blog!
  • egÃ¥roht · 2 years ago
    Excellent. Just what I needed to know. Have been sitting some hours scratching my head sore. Thanks :-)
  • shailesh · 2 years ago
    We are facing the similar situation. When we create the entity, many to many association gets created but when we just try to create the association between already exisitng objects, we get no error and no association gets created. We tried it with flush before and after but of no use.

    -Shailesh
  • paulrene · 1 year ago
    I've been stuck on this for 3 days now! Thank you so much for the solution! This should be mentioned in the Hibernate FAQ. I'll drop them a letter.. ;)
  • Marko Novakovic · 1 year ago
    My GOD.... Thanks very much.. More than few days of reading official documentation and couldn't find a solution. Thanks again
  • Venushka · 1 year ago
    Thank you! You are super!