3
我使用的建設,「如果」,在HSQL:使用在建工程在休眠
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。我怎樣才能做到這一點? 謝謝。