我试图在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')
当app编译时,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中它工作正常。