• 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

Hibernate: many-to-many cascading

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

I've been reading up on many-to-many associations on the web and in Hibernate in Action, but I couldn't find the answer to my problem.

I've got an Object of my own class Query, I would like to add some security to this object, so I've created a User object. Each query can have several users that can access it, and each user can have several queries it can run..

This is the part of the query mapping file:


When I create a Query Object, I fill the users-set with UserQuery objects, but when I save the query (session.saveOrUpdate(query)), I get an exception:



Is it possible to save a many-to-many on cascade, or should you do it manually.. if it's possible.. what am I doing wrong?

Thanks in advance!!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic