If we are limiting this alteration to *just* cases where there is an
"@EntityResult" associated with that particular query result, then I guess
I could see this. But I'd be very opposed to forcing implementors to do
this for all other cases.
On Thu, May 4, 2017 at 7:01 AM Guillermo González de Agüero <
z06.guillermo_at_gmail.com> wrote:
> Hi,
>
> AttributeConverter's are one of my favourite JPA 2.1 features, but
> unfortunately, the spec only mandates them to work on JPQL queries and
> Criteria queries. Its behaviour on native queries is unspecified (point 3.9
> of the spec):
>
> *"[...] The persistence provider must apply any conversion methods to
> instances of attribute values in path expressions used within Java
> Persistence query language queries or criteria queries (such as in
> comparisons, bulk updates, etc.) before sending them to the database for
> the query execution. [...] If the result of a Java Persistence query
> language query or criteria query includes one or more entity attributes for
> which conversion mappings have been specified, the persistence provider
> must apply the specified conversions to the corresponding values in the
> query result before returning them to the application. [...]"*
>
> As a user, I expect them to also work on native queries, and EclipseLink
> already does that. However, it doesn't work on Hibernate, and the spec
> doesn't force it to work. This drastically reduces the possibilities of
> this feature, as they can only be used on entities where no native queries
> are involved.
>
> I propose to rephrase point 3.9 in order to account for native queries in
> addition to JPQL and Criteria ones. Was it an intended omission on 2.1 or
> did it just wend unnoticed?
>
>
> Regards,
>
> Guillermo González de Agüero.
>