我在使用Hibernate HQL的SQL Server查询上运行组时遇到一些问题。相关表格包含NTEXT
列。请注意两个CONVERT
字段...
然而,Hibernate对此嗤之以鼻。关于如何最好地将其传递给Hibernate层的任何建议?
SELECT CONVERT(NVARCHAR(4000), A.DESCRIPTION),
CONVERT(NVARCHAR(4000), A.NEWS),
....
FROM ACCOUNT A
INNER JOIN A
...
GROUP BY CONVERT(NVARCHAR(4000), A.DESCRIPTION ),
CONVERT(NVARCHAR(4000), A.NEWS)
错误讯息:
[16:45:12.067] uncaught ERROR: No data type for node: org.hibernate.hql.ast.tree.MethodNode
+-[METHOD_CALL] MethodNode: '('
| +-[METHOD_NAME] IdentNode: 'convert' {originalText=convert}
| \-[EXPR_LIST] SqlNode: 'exprList'
| +-[METHOD_CALL] MethodNode: '('
| | +-[METHOD_NAME] IdentNode: 'nvarchar' {originalText=nvarchar}
| | \-[EXPR_LIST] SqlNode: 'exprList'
| | \-[NUM_INT] LiteralNode: '4000'
| \-[DOT] DotNode: 'account0_.Description' {propertyName=description,dereferenceType=ALL,propertyPath=description,path=a.description,tableAlias=account0_,className=classAlias=a}
| +-[ALIAS_REF] IdentNode: 'account0_.AccountID' {alias=a, className=com.recruitni.model.Account, tableAlias=account0_}
| \-[IDENT] IdentNode: 'description' {originalText=description}