我正在使用HSQL中的条件语句"if":
String q = "SELECT id, name, " +
"IF (ABS(name) > 0, LPAD(ABS(name), 4, '0'), name) AS tord " +
"FROM table where city= " + cityId + " order by tord";
Query query = session.createSQLQuery(q);
List<Object[]> list = query.list();
session.getTransaction().commit();
session.close();
现在我想用HQL重构这段代码。我该怎么做?谢谢。