[hibernate-dev] Plan on adding the JPA 2.2 Query#getResultStream() in 5.2

Vlad Mihalcea mihalcea.vlad at gmail.com
Wed Aug 2 16:16:27 EDT 2017


>
> Sure, but you may not publish something like an JPA 2.1+ with just some of
> the 2.2 methods.


I don't understand this part because, for instance, we already support Java
1.8 Date/Time types for quite some time. So, Hibernate 5.x already supports
JPA 2.1 +.

The 5.1 Stream support is also in the JPA 2.1+ category too. The only
difference is that the method is called stream and not getStreamResult.

Now, back to the org.hibernate.query.Query method:

default Stream<R> getResultStream() {
   return stream();
}


Even if the JPA 2.2 define this method, we can still implement it as a
default method and that will work for both JPA 2.1 and JPA 2.2, right?

I've never considered changing the dependencies in any way. It's just this
method that makes it easier to use Hibernate 5.2 with both JPA 2.1 and JPA
2.2 API.

Vlad

On Wed, Aug 2, 2017 at 8:40 PM, Gunnar Morling <gunnar at hibernate.org> wrote:

> Sure, but you may not publish something like an JPA 2.1+ with just some of
> the 2.2 methods.
>
> 2017-08-02 17:40 GMT+01:00 Sanne Grinovero <sanne at hibernate.org>:
>
>> On 2 August 2017 at 17:07, Gunnar Morling <gunnar at hibernate.org> wrote:
>> >> You don't plan on actually updating the JPA API we use at build time
>> >> right?
>> >
>> > We cannot do that, you may not provide a version of a spec'ed API with
>> > additional methods. It'd have to be in ORM's sub-interface or similar.
>>
>> The new spec'ed API already has this method.
>>
>
>


More information about the hibernate-dev mailing list