| Removing the addEntity does change the behaviour. But in my case (using SQL Server) the generated SQL is invalid. Without generics the generated SQL is correct, but with generics the generated SQL is invalid. Aftrer some testing I found out that the "SELECT {u.*} " causes the problem. Changing it to "SELECT u.*" worked. But it is problematic that the same SQL statement behaves differently depending on which version of createNativeQuery is used. |