I have been working with Java EE related technologies for the past twelve years. My area of expertise has been Core Java, EJB, XML, XSLT. My exposure has largely been in persistence and its related technologies. I have dabbled in EJB 1.1, TopLink and the current favorite Hibernate. Besides persistence technologies I have used Open Source technologies like Castor, XStream, Velocity.
I have been a Project Manager for around 4 years in a reputed Indian IT company. However my first love continues to be technology and this site is my oasis where I intend to share my day-to-day technical on goings.
For past five years I have been playing a technical role and since then have been cruising thru a number of Java based technologies.
Hi
Please help me out in resolving the following problem
I have three table NOTE_DETAILS,CUSIP_DETAILS,ORDER_DETALS.
There is a uni directional one-to-one relation exists between
NOTE_DETAILS,CUSIP_DETAILS.
and one-to-many relation exists between NOTE_DETAILS ,ORDER_DETALS.
When iam updating the NOTE_DETALS bean the CUSIP_DETALS bean,List of
ORDER_DETALS beans should get inserted automatically.
Is it possible to do like this.
Plz advise.
Thanks
Anupama
Anupama,
As long as you have defined the hibernate relationships properly any changes made to a persistent object should be automatically done on session.save() invocation. For configuration details please refer my two posts titled “Investigating Hibernate Associations – One to One” and “Investigating Hibernate Associations – One to Many”.
Hello !
Nice blog of yours !
I just read a nicely written article on hibernate many to many relationship.
It did the job and solved the issue I had. Cheers!
As a newbie in Hibernate I now have a question:
Is there any point in having a UNI-directional many to many relationship..?
Thanks
Stephane
PS: No Grails on your blog..?
Many thanks for your kind words.
There is definitely a point in having a uni-directional many-to-many relationship. Let’s take the example of a many-to-many relationship between Person and Address or the example in my blog Person and Phone. One would ideally want to navigate from Person to his/her address/phone, but I doubt there are many real-world requirements to move from Phone to Person or Address to Person.
I hope I have answered your question.
Sorry but I am not into Grails development. I am currently working on Flex. So you can expect some Flex related stuff soon.
V-Nay Good show. Like your blog
your blog helped me to resolve column span issues in my table layout. well organized info, thanks much
nice yar,thanx.