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
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.
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
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