File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Retrieve relationship between hibernate entities  via Code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Retrieve relationship between hibernate entities  via Code" Watch "Retrieve relationship between hibernate entities  via Code" New topic
Author

Retrieve relationship between hibernate entities via Code

Ally Cavs
Ranch Hand

Joined: Aug 25, 2008
Posts: 89
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieve relationship between hibernate entities via Code