We're updating the issue view to help you get more done. 

org.hibernate.Session.*Query(Ljava/lang/String) methods return different types in 5.1 and 5.3

Description

although mentioned in HHH-12424, it doesn't seem to be resolved

in 5.1
org.hibernate.Session.createQuery(Ljava/lang/StringLorg/hibernate/Query

in 5.3
org.hibernate.Session.createQuery(Ljava/lang/StringLorg/hibernate.query.Query

It happens when code compiled with Hibernate ORM 5.1 is run with Hibernate ORM 5.3

I attached very simple reproducer class.

1 2 3 4 5 6 7 8 9 10 11 # compile with Hibernate 5.1 javac App.java -cp ~/.m2/repository/org/hibernate/hibernate-core/5.1.9.Final/hibernate-core-5.1.9.Final.jar # run with 5.1 => ok java -cp .:/home/msimka/.m2/repository/org/hibernate/hibernate-core/5.1.9.Final/hibernate-core-5.1.9.Final.jar App # run with 5.3 => fail java -cp .:/home/msimka/.m2/repository/org/hibernate/hibernate-core/5.3.1.Final/hibernate-core-5.3.1.Final.jar:/home/msimka/.m2/repository/javax/persistence/javax.persistence-api/2.2/javax.persistence-api-2.2.jar App Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.Session.createQuery(Ljava/lang/String;)Lorg/hibernate/Query; at App.main(App.java:35)

other methods with the same issue:
java.lang.NoSuchMethodError: org.hibernate.Session.getNamedQuery(Ljava/lang/StringLorg/hibernate/Query;
java.lang.NoSuchMethodError: org.hibernate.Session.createSQLQuery(Ljava/lang/StringLorg/hibernate/SQLQuery;

This probably also affects:
SessionImplementor.getNamedSQLQuery(String p1) [abstract] : org.hibernate.Query

In 5.3,
SessionImplementor.getNamedSQLQuery(String p1) returns org.hibernate.query.spi.NativeQueryImplementor

Environment

None

Status

Assignee

Gail Badner

Reporter

Martin Šimka

Labels

Fix versions

Priority

Major