>Was the initial problem you just using SessionImpl directly?
Yes, that was the problem,
so probably there are no JDK's handling it differently.
From: hibernate-dev-bounces(a)lists.jboss.org [mailto:email@example.com]
On Behalf Of Steve Ebersole
Sent: Wednesday, March 14, 2012 4:46 PM
To: Guillaume Smet
Subject: Re: [hibernate-dev] Covariant returns
Was the initial problem you just using SessionImpl directly? Or is it a problem of
particular JDK handling the covariant return differently? In the latter case we'd
need to change the code. In the former, its a discussion.
As for why byId is that way, TBH being new to being able to design APIs with Java 5+
features I tend to try things to see how they work.
On 03/13/2012 06:55 PM, Guillaume Smet wrote:
On Tue, Mar 13, 2012 at 10:39 PM, Steve Ebersole<steve(a)hibernate.org> wrote:
> As I understood it, when accessed through the Session interface what
> return type is defined by SessionImpl is irrelevant. And indeed I am
> not able to reproduce this when access those methods via Session. My
> IDE gives me errors if I try to cast that reference to SessionImpl
I tested it quickly in the test case I was working on and I confirm it
works (with the Eclipse compiler and directly with Maven and the
Oracle JDK 1.6.30 compiler).
That said, I don't understand why you return the Impl instead of the
interface: it's not consistent with byNaturalId() and
bySimpleNaturalId() which are just below. Is there any reason why you
treated them differently?
hibernate-dev mailing list