Some methods returning org.hibernate.query.Query are not defined for StatelessSession

Description

There are some methods returning org.hibernate.query.Query that are available to Session, but not StatelessSession.

I'm looking into moving the following non-JPA methods from Session into SharedSessionContract, so they are available to both Session and StatelessSession:

1 2 3 4 5 @Override org.hibernate.query.Query createQuery(String queryString); @Override org.hibernate.query.Query getNamedQuery(String queryName);

In addition, the following method should be copied into StatelessSession (it can't be moved up to SharedSessionContract because it conflicts with a default method in QueryProducerImplementor):

1 2 @Override NativeQuery createSQLQuery(String queryString);

Also, at this point, org.hibernate.query.Query is stable enough that we can remove @Incubating. That will clarify that references to org.hibernate.Query should be changed to org.hibernate.query.Query.

Note that the following do not need to be added because they are already declared in QueryProducer:

1 2 <T> org.hibernate.query.Query<T> createQuery(String queryString, Class<T> resultType); <T> org.hibernate.query.Query<T> createNamedQuery(String name, Class<T> resultType);

--------------------------------------------------------------------------------------------------------------------------------------

Background:

In 5.2:

  • org.hibernate.query.Query was introduced, annotated with @Incubating;

  • org.hibernate.Query was deprecated, indicating that org.hibernate.query.Query should be used instead;

  • references to org.hibernate.Query were changed to org.hibernate.query.Query in the user guide.

The documentation for @Incubating says:

1 2 3 4 5 * Marks (recursively) certain of Hibernate's packages, types and methods * as incubating. Incubating indicates a type or method that is still being * actively developed and therefore may change at a later time. Users of these * types and methods are considered early adopters who help shape the final * definition of these types/methods.

This causes a dilemma about whether applications should migrate from the old API to the new class.

Environment

None

Status

Assignee

Gail Badner

Reporter

Gail Badner

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.3.7
5.4.0

Priority

Major