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}}:
{code:java} @Override org.hibernate.query.Query createQuery(String queryString);
@Override <T> org.hibernate.query.Query<T> createQuery(String queryString, Class<T> resultType);
@Override org.hibernate.query.Query getNamedQuery(String queryName);
<T> org.hibernate.query.Query<T> createNamedQuery(String name, Class<T> resultType); {code}
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)}}:
{code:java} @Override NativeQuery createSQLQuery(String queryString); {code}
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}}.
--------------------------------------------------------------------------------------------------------------------------------------
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:
{code:java} * 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. {code}
This causes a dilemma about whether applications should migrate from the old API to the new class.
Should {{org.hibernate.Query}} be undeprecated?
Could/should {{org.hibernate.query.Query}} be deprecated?
|
|