-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Sorting Results Using QBE
PostPosted: Tue Nov 21, 2006 5:33 pm 
Beginner
Beginner

Joined: Tue Sep 20, 2005 11:01 am
Posts: 25
Hibernate version:3.2


I'm using the Query By Example (QBE) technique to get a list of Facilities. I want to sort the results by Facility name. Everything works accept the the "ignoreCase()" has no effect.

Am I doing something wrong?


Code:
   public static List findFacility(Session hSession, Facility facility, int firstResult, int maxResults)
   throws HibernateException {
      List facilities;
      try {
         Example exampleFacility= Example.create(facility)
         .enableLike(MatchMode.ANYWHERE)
         .excludeProperty("privateOwnedFlag")
         .excludeProperty("smallCommunityExceptionFlag");
         
         facilities = hSession.createCriteria(Facility.class)
         .add(exampleFacility)
         .addOrder(Order.asc("name").ignoreCase())
         .setFirstResult(firstResult)
         .setMaxResults(maxResults)
         .list();

      } catch (HibernateException he) {
         log.error("Unable to  search for the Facilities by example ");
         log.error("Unable to  search for the Facility Error is : " + he);
         throw (he);
      }       
      return facilities;
   }


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.