Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which is the give good performence ?

 
Barry Van
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Please tell me any one given below doubt:-
Which is the give good Performance between this two, when we use for find the results :-
1) Hashtable equals = new Hashtable();
equals.put("WorkExperience", workExperience);
equals.put("JsLinguisticVersion", lingVersion);
List results = commonDAO.doQuery(className, equals, null, null);
if (results.size() > 0) {
-----------------
------------------
}

2) Query q = session.createQuery(selectClause.toString()
+ fromClause.toString() + whereClause.toString()
+ orderbyClause.toString());
List results = q.list();
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are too many blanks in the code to answer that. What does commonDAO.doQuery do? Why are you using a Hashtable?

As with any performance question the best way to answer it is too benchmark both.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HQL can be better than criteria type queries. I'd guess 2.

Still need more info.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic