Unexpected token: null near line 1, column 290, unexpectedtoken
Org. hibernate. hql. internal. ast. querySyntaxException: unexpected token: null near line 1, colum290 [select count (*) from cn.com. taiji. sample. entity. user t where 1 = 1 and (t. name like: userName or t. namePy like: userName or t. loginName like: userName and t. status =: status and not exists (select B. user from cn.com. sample. entity. userRole B where B. role. id =: roleId and B. user. id = t. id)]
This is an error I reported. The cause of the error is a syntax format error. The entire HQL statement is also here. Combined with the online search solution, it is summarized as follows:
1. Extra Spaces;
2. the string quotation marks should be single quotation marks;
3. =: there should be no spaces in the middle. 'Like: 'The intermediary must have spaces. In fact, this is not so rigorous, Just in case;
4. Brackets. The problem I encountered was that the left bracket had one more than the right bracket;
There may be other reasons, and I hope to help you!