Reputation: 45
Lets say for example I have the following query (simple one but I know we use native sql queries only when we have complex ones which cannot be written as named queries)
String query = "select top 1 id from comp_job_processing_cycle order by start_date desc"
Now I was told that we are supposed to write these native sql queries in somefile.hbm.xml file rather than the way I have written in a java file. Why is that?
Upvotes: 0
Views: 263
Reputation: 122006
My reasons are
And I usually place respective queries in respective bean mapping file.
Upvotes: 1