我正在尝试在 Hibernate SQL 查询中使用 COLLATE 语句,但是它无法识别该语句。
CONSULTA: FROM Articulos WHERE activo=0
and (codigodearticulo like '%CIN EMB%' COLLATE='Modern_Spanish_CI_AI'
or descripcion like '%CIN EMB%' COLLATE='Modern_Spanish_CI_AI'
or descripcionadicional like '%CIN EMB%' COLLATE='Modern_Spanish_CI_AI' )
and codigodelinea in
(select CODIGODELINEA from Lineas where CATAUTOPARTES='1')
当应用程序编译时,Hibernate 返回此异常:
- line 1:107: unexpected token: COLLATE
- line 1:107: unexpected token: COLLATE
- line 1:107: unexpected token: COLLATE
- Error hibernate: unexpected token: COLLATE near line 1, column 107
我找不到问题,在 MSSQL Server 中它工作正常。