HQL update statement fails if entity is inside a package of format in.mycomany.domain.Entity

Description

My company domain is of the format mycomany.in

I have changed my project's package from com.mycompany -> in.mycompany to keep it consistent with my company's domain.

After the migration, hibernate update queries are failing saying

unexpected token: in antlr.NoViableAltException: unexpected token: in

The actual query that ran was of this format

update Entity e set e.prop = ?1 where e.id = ?2

Here is the cleaned log

QueryTranslatorImpl: parse() - HQL: update in.mycompany.domain.Entity e set e.prop = ?1 where e.id = ?2 ErrorCounter: line 1:8: unexpected token: in

This error occurs only for update statement, but not for select for some reason.

This error occurs in org.hibernate.hql.internal.ast.QueryTranslatorImpl in the following section.

private HqlParser parse(boolean filter) throws TokenStreamException, RecognitionException { // Parse the query string into an HQL AST. final HqlParser parser = HqlParser.getInstance( hql ); parser.setFilter( filter ); LOG.debugf( "parse() - HQL: %s", hql ); parser.statement(); .... }

Activity

Show:

KwonNam SonJuly 9, 2018 at 5:57 AM

Is this really fixed in 5.0.11?
I have the same problem with hibernate 5.0.12.

Andrea BorieroJuly 17, 2016 at 8:14 PM

Former userJuly 14, 2016 at 7:14 PM

Please attach a runnable test case that reproduces your issue. The test code at https://github.com/hibernate/hibernate-test-case-templates can be used to create a runnable test case.

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Created July 13, 2016 at 12:26 PM
Updated July 9, 2018 at 5:57 AM
Resolved August 4, 2016 at 12:06 PM

Flag notifications