• 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

Retrieve relationship between hibernate entities via Code

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

Unusual question, but if i have a parent entity, can I query on the relationship itself and its child attributes. I have very unusual cirumstances, where by if a parent entity has a child entity that is a List, I need to check if that child List has a <many-to-many> relationship or not.

im writing a hibernate listener which is to write out audit details (eg userid, what they changed, etc) to a audit table for every transaction. This listener is using reflection to see what values are different between the entity about to be persisted and the Database. So the listener could recieve any entity. hence why I cant code in for particular entities. I want to have this in a seperate jar for this listener and reflection code that can be dropped into any hibernate project. I have it all working except for 1 scenario where i need to check is the relationshsip a many-to-many.

Thanks
Alan
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic