posted 13 years ago
Ok. I did some more coding to understand the concept and found the following
This are my Event, Attendee, Location,Speaker classes.
These are my config files.
Now if i try to do the following
Case1: Instantiating only Event and not associated object(Attendees, Speaker)
i get the following output sql.
But if i perform the following operation
Case2: Instantiating Event and associated object(Attendees, Speaker) as shown below
i get the following output sql.
Conclusion:
Does that mean that when i save only Event(Case1), only inserts is done.
If i save Event, which has associated speaker and attenedes(Case2)
first Event is inserted, then the speakers and attendes are inserted and finally the event_id are set in speakers and attendees.
Why does hibernate perform inserts and update, when the entire operation could have been done using inserts. Is there any advantage of doing so?
SCJP 1.4, SCWCD1.4, OCA(1Z0-007)