aspose file tools*
The moose likes Object Relational Mapping and the fly likes Is there a necessity in writing SQL queries in xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Is there a necessity in writing SQL queries in xml file" Watch "Is there a necessity in writing SQL queries in xml file" New topic
Author

Is there a necessity in writing SQL queries in xml file

Venkat dasari
Ranch Hand

Joined: Nov 12, 2003
Posts: 67
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


Regards,<br />Venkat Dasari<br />SCJP 1.4, SCBCD.
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a necessity in writing SQL queries in xml file