On 3 January 2017 at 11:39, Gunnar Morling <gunnar(a)hibernate.org> wrote:
2017-01-03 11:57 GMT+01:00 Sanne Grinovero
<sanne(a)hibernate.org>:
>
> It sounds great but I'm not sure it's possible?
WDYM specifically?
> For example how would this handle projections? I guess it's a similar
> doubt as the one Gunnar shared, but while he suggests a semi-typesafe
> solution, I'm not sure how cool it is to give the feeling that types
> are being checked when they might actually blow at runtime, if the
> query string doesn't match expectations.
> Could an Annotation Processor verify the declared return types really
> match the HQL select?
I understand your point, but isn't it the same for createQuery( "from
Foo",
Bar.class )? This also will only be detected at runtime. I.e. I don't see
how it's worse for the tuple approach?
Yes it's the same problem: I wish we could fix that too.
If only someone here was a expert of annotation processors maybe he
could tell me if I'm dreaming :D