This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am new to hibernate and I want to use hibernate to insert the data in database(ORACLE).I have done some search on hibernate and i am able to store data and retrive data from one table.Now in my application we have three table
Table A , B , C
Relationship A - B(1-Many) - one record in A and many records in B for the same record
A - C( 1-1)
How do i use hibernate to insert records in all three tables ? at one go..
James [ September 05, 2004: Message edited by: james edwin ]
hi, I am also new to hibernate..i am still trying to insert records into the database. will you please help me how to do it? Moreover, how to retrieve values from two tables since it returns an object array... for example i have a sample database emp and dept... i want all the details of employees along with their location whose deptno=10...
please do help me regarding this.. Thanking you, Venkat Dasari
you can set a "cascade" mode for each relation: cascades
if you set the correct cascade mode, then hibernate will take care of storing/deleting your related objects.
Joined: Jun 19, 2001
i think you better post a new question in a new topic.
it is hard to answer such a general question, perhaps you should first read one of the tutorials on hibernat, learn how to insert/query a single object and then do the next step and add relations to your objects.
As a hint for your problem: you can query for objects using HQL. HQL is similar to SQL. if you have a specifi question then dont forget to post the code you have so far.