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.
Hi, I am new to this hibernate. I had gone through some .pdf on hibernate. There i came to know that the queries were generated at runtime... But when i downloaded some sample codes i had seen a query been written in xml file..
I need some clarifications regarding this. I think, I asked a dumb question. Any answer would be appreciated. Thanks, Venkat Dasari
Are you sure it was sql and not hql? never the less consider what hibernate is doing. It's primary function, for me anyway, is to generate sql and give me objects based on the data it retrieved and using the mapping files, and using my objects generate sql and update the db, but this is not always suitable, sometimes you want to use raw sql to improve performance perhaps, bulk inserts/deletes are good examples. Now to answer your question directly, no, I have no sql in any xml file, I do however have hql in a properties file, but that's not a requirement either.
Read the tutorials, there are many links from the hibernate site, good ones.