Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.0 
I tried a following code 
Code:
Criteria cri = session.createCriteria(Instrument.class);
         
   instrument = cri.add(Restrictions.like("shortName", "%" +description + "%").ignoreCase())
                    .setFetchSize(3)
                    .list();
  this code should return me 3 records .. But it returns 
more than 3 records But if i try 
Code:
Criteria cri = session.createCriteria(Instrument.class).setMaxResults(3);
            instrument = cri.add(Restrictions.like("shortName", "%" + description + "%").ignoreCase()) .list();
Quote:
this works fine . i want to know why the setMaxResults() work and not setFetchSize()