Menu

IgnoreCase for the sorting clause

2014-10-29
2014-10-29
  • youssef arfaoui

    youssef arfaoui - 2014-10-29

    Hi,

    is the ignoreCase() supported in TSQB sorting clause?

    I can do it using the Hibernate Criteria like this

    getHibernateTemplate().execute(new HibernateCallback() {
    @Override
    public Object doInHibernate(Session session) throws HibernateException {
    Criteria criteria = session.createCriteria(RefLanguage.class, "refLanguage")
    .addOrder(Property.forName("language").asc().ignoreCase());
    return criteria.list();
    }
    });

    but I want to use TSQB framework if it's possible.

    Thanks for your help :)

    Youssef

     
  • youssef arfaoui

    youssef arfaoui - 2014-10-29

    I have checked the TSQB source code. it's not supported. the workaround is to use lower() hql function . something like this.

    TypeSafeRootQuery query = typeSafeQueryDao.createQuery();
    RefLanguage refLanguageProxy = query.from(RefLanguage.class);
    query.orderBy().asc(query.hqlFunction().lower(refLanguageProxy.getLanguage()));
    return typeSafeQueryDao.doQueryResults(query);

    it will be nice if it's supported

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.