Just recently started learning Hibernate.. Here Im posting some sample code which I have got the output perfectly, but I havent understood exactly the generated SQL queries. Please see the whole code ...
Here are the SQL queries generated after executing that "Main" class... Please explain me how hibernate considering what order so that it displayed those SQL queries .. I mean why it inserted first LOCATION then EVENT then SPEAKER then again LOCATION then EVENT_LOCATION ?? Im unable to understand the order of those sql queries..
waiting for replies...
Joined: Sep 01, 2010
Please anyone reply to this..... Im very much interested to know how Hibernate thinks.... pleasse someone understand my whole code and provide me understanding...
My actual doubt is considering my Main.java code, how its generating SQL squeries?? Im getting those SQL generated queries considering my Main.java code or any thing other reason?? I would like to know why it inserted Location, then Event, then Speaker, then again Speaker, then Location, then Event , then EVENT_LOCATION ( 4 times) , howz it all going?? why it generating those sql queries in that order by considering what??
Does ordering have any relevance? No, it doesn't. But: Some statements MUST be fire earlier than others, because you need an identifier or something for some other statements. If you don't have any condition like that, you shouldn't care about.
If you are interested on it because you want to understand whats "under the hood" take a look at the sources as Paul said.