Hello
I am writing sql commands, with the use of hibernate, I want to retrieve objects named “LOAN”, that have 2 or more lists, I want the lists’ members, and performance is important for me.
I’ve already used this way…. At first I retrieve the LOAN objects with addEntity command, and then with iterating on lists, retrieve the Id of the members, and then retrieve each of the list members, with a sql command by sending its id as a parameter.
So a lot of commands are needed!
I wonder if it is better to retrieve all the list members with a uniqe command?
here is the code I’ve used:
((SqlQuery)session.createSqlQuery(sql)).addEntity(“LOAN”, Loan.class)
ps: My boss has forced me to use SQL instead of HQL with hibernate,
(because of HQL problems in performance!…) I don’t know if this is right? I would be appreciated, if somebody could help me with this, too.