1 - If I remove from the query "order by o.donglePointPK.timestamp", there is no duplication.
2 - If I run a NamedQuery see "findDonglePointsWithinRange" in DonglePoint Class, there is no duplication.
3 - If it's a simple attribute from the classe (not an object), there is no duplication.

Did anyone ever see something like that? Is it a problem from JPA or am I doing something that I wasn't supposed to do?

What EclipseLink version are you using, and does it reproduce on the latest 2.4 release? The only difference I see between the named query and the JPQL one is the distinct clause - does your JPQL query have the issue if you remove the 'distinct' from it? It doesn't seem neccesary for the query results since the entity should be unique anyway.

This looks like it should work though, so please file a bug if it still reproduces on the latest version.

The version is 2.3. I'm downloading the latest release to see if there is any problem. Yes, the only difference is the distinct clause, since I thought it wouldn't be the problem, I never tried. I will give a shot, maybe it could be the problem anyways.

I will try without the 'distinct' to see first, if it doesn't work I will try the latest version of EclipseLink with and without "distinct". Whatever the result, I will come to share it.