What is the fastest findByName query with hibernate?

Posted by Karussell on Stack Overflow See other posts from Stack Overflow or by Karussell
Published on 2010-06-15T19:29:43Z Indexed on 2010/06/15 19:32 UTC
Read the original article Hit count: 220

Filed under:
|
|
|
|

I am sure I can improve the performance of the following findByName query of hibernate:

public List<User> findByName(String name) {
  session.createCriteria(User.class).add(Restrictions.eq("name", name)).list();
}

In which way should I improve it or even more important: in which ways should I improve it first? I will need the full object with all the collections (layz or not) and deps of this class.

© Stack Overflow or respective owner

Related posts about java

Related posts about database