QuerySyntaxException: expecting OPEN, found '.'

Hi Everyone,

I am using hibernate 5.x to execute a name query as
query = getSession().getNamedQuery(GET_USR_MSG_DETAILS);

But I am getting Exception during execution of test case as :-
getUsrMsgDetails failed because of: org.hibernate.hql.internal.ast.QuerySyntaxException: expecting OPEN, found ‘.’ near line 2, column 55 [SELECT u.code, u.lang, u.usrMsg, e.occurs from
in.raj.entity.UsrMsgDetails u , in.raj.entity.UsrErrMstr e where e.code = u.code and e.retiredOn
IS NULL]

Please suggest , how can I avoid this error.

Regards,
Raj

Be that as it may, I am getting Exemption amid the execution of experiment as:-

getUsrMsgDetails fizzled as a result of: org.hibernate.hql.internal.ast.QuerySyntaxException: anticipating OPEN, discovered ‘.’ close line 2, segment 55 [SELECT u.code, u.lang, u.usrMsg, e.occurs from

in.raj.entity.UsrMsgDetails u , in.raj.entity.UsrErrMstr e where e.code = u.code and e.retiredOn

IS NULL]

I struggled with this for over two weeks or so in 2017. Got to know the reason is due to package name starting with ‘in.’

in your case ‘in.raj…’ change your package name to start from ‘com.raj…’ and this will be solved for sure.

I know for a fact that this was fixed at some point (don’t recall the issue number) but with a recent Hibernate version, this should not be a problem anymore.