Description of problem: HQL such as Query query = entityManager.createQuery("select u from Foo u where u.travelClass = :class"); query.setParameter("class", travelClass); was OK in EAP 6.2, but fails on EAP 6.3 since ER2 Version-Release number of selected component (if applicable): Hibernate 4.2.12.Final-redhat-1 How reproducible: Always Steps to Reproduce: 1. Change the EAP "greeter" quickstart src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.java to Query query = entityManager.createQuery("select u from User u where u.username = :class"); query.setParameter("class", username); 3. deploy, run and enter name "jdoe" Actual results: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: : near line 1, column 81 [select u from org.jboss.as.quickstarts.greeter.domain.User u where u.username = :class] Expected results: Application should greet jdoe. Additional info: An example application using "class" in parameter name has been spotted in the wild: https://github.com/spring-projects/spring-ws-samples/blob/master/airline/server/src/main/java/org/springframework/ws/samples/airline/dao/jpa/JpaFlightDao.java
Changing this to low priority since it's really simple to workaround (just change the param name). Honestly, this should probably be a WONTFIX, as "class" has always been reserved in HQL (at least I thought it was). The fact that it "worked" up until now was probably a fluke. HQL received several important fixes between EAP 6.2 and 6.3 that probably exposed this.
We recently rejected a few others that were related: https://hibernate.atlassian.net/browse/HHH-9154
Is there any list of all the reserved keywords that might be affected, so that they can be added to the release notes?
This really should be treated as a regression so I'm raising the severity back to high. I'm looking into this.
HHH-9154 was re-opened and fixed. The fix has been backported to 4.3 and 4.2.
I've asked Steve Ebersole about reserved words affected by this bug. I'll provide them when I get an answer.
I would not say this is a blocker. It can be deferred.
Either it is a regression, in which case it has be fixed now, therefore would be a blocker, or it is not a regression in which case it doesn't have to be fixed at all. Deferring it now would mean affected users would have to migrate their applications anyway for EAP 6.3 and then later allowed to migrate to their old queries back again when this is fixed, which would be silly. The only way this issue should not be considered a regression and therefore not a blocker, would be if the HQL indeed forbade ':keywords' as parameter names, in which case the current behavior would not be a bug, but a bug fix.
I agree that this is regression. It could affect existing customers' applications therefore I'm adding blocker? flag.
Corrected under https://hibernate.atlassian.net/browse/HHH-9154
I'm ok with fixing it in 6.3, but I'll wait to act until we get the ACKs. I'm not sure where we're currently at in the schedule.
I will release hibernate-orm 4.2.13.Final with the fix by Wednesday 5/28. David Stahl will take it from there.
IIUC, this does not need to be in the release notes, since this was a regression that turned up in EAP 6.3 ER2, that will be fixed in 6.3.0.
Indeed.
Verified in EAP 6.3.0.ER7. There is also a new testcase for this feature: org.hibernate.test.hql.ParameterTest and it passes.