Several methods in the interface org.hibernate.query.Query are inherited from the @Deprecated org.hibernate.Query interface, but are not marked as deprecated in org.hibernate.Query and not @Override in org.hibernate.query.Query. These include scroll() and setParameterList(). When used, these methods are flagged as Deprecated by the compiler due to their declaration in org.hibernate.Query. However, these are still used internally by non-deprecated methods in AbstractProducedQuery, and scroll() does not have a non-deprecated equivalent.
If these are not deprecated, please @Override them in org.hibernate.query.Query. If they are, please add deprecation notes in the javadoc for replacements.
I think methods like org.hibernate.Query#setParameterList() should be overridden by org.hibernate.query.Query in order to not return the deprecated org.hibernate.Query.
For the scroll() method it is not flagged as deprecated by the compiler.
The problem is that both setParameterList() and scroll() are defined on the deprecated org.hibernate.Query not org.hibernate.query.Query. Therefore the definition is from the Deprecated interface.
This is this the warning I am receiving from the Oracle/Sun JDK 1.8:
The method scroll(ScrollMode) from the type Query<PjmRtAvgBucket> is deprecated
The method needs to be overridden in the org.hibernate.query.Query() for the deprecation warning to be resolved, as setMaxResutls()
Are you calling setParameterList() and then setMaxresults() and scroll()?
Here's an example of the warning using the session directly:
I also get the warning using:
I added all your examples to a test method and committed it as well.
Then, I activated -Xlint in Gradle:
I run the test in question:
And this is the actual output:
As you can see, there are warning, but not for CriteriaCompilingTest.
I'm also using Oracle JDK:
Can you paste the output that you get when running this test?