users@glassfish.java.net

Re: getSingleResult behaves different in GlassFishV1 and V2?

From: <glassfish_at_javadesktop.org>
Date: Wed, 17 Oct 2007 09:53:48 PDT

Hi,

I do not know what has been changed between V1 and V2. But the reason for the NonUniqueResultException might be that the query result includes the same instance multiple times (because of the JOIN clauses). Could you please try adding a DISTINCT to the SELECT clause of the named query:

SELECT DISTINCT u FROM Usuarios u JOIN u.iDperfilCollection t JOIN u.iDclientesCollection c WHERE u.sNombreUsuario = :sNombreUsuario

Regards Michael
[Message sent by forum member 'mb124283' (mb124283)]

http://forums.java.net/jive/thread.jspa?messageID=240710