I have been working with Java EE related technologies for the past nine and a half 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 3 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.
Last year I got an opportunity to move into a more technical role and since then have been cruising thru a number of Java based technologies.
4 responses so far ↓
Anupama // October 18, 2008 at 10:09 am |
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
Mr. President // October 18, 2008 at 11:26 am |
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”.
Stephane // January 28, 2009 at 2:15 pm |
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..?
Mr. President // January 28, 2009 at 2:39 pm |
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.