hql 长度函数length()

sql:

SELECT [id]
      ,[parentId]
      ,[name]
      ,[code]
      ,[isDisplay]
      ,[description]
      ,[isSystem]
  FROM [jxwpgsh].[dbo].[SYS_DICTIONARY]
 order by len([code]),[code]

 

 

hql:

from SysDictionary d where d.parentId=? order by length(d.code),d.code 

 

你可能感兴趣的:(hql 长度函数length())